Commit graph

166 commits

Author SHA1 Message Date
Maximilian Bosch a532cb052e
nixos/containers: add boot.isNspawnContainer option
There are a bunch of components such as incus or LXC that also use
`boot.isContainer`, so we'd have to differentiate between "OS container"
and "actually nspawn".

This became necessary for the file-systems part where nspawn takes care
of setting up special filesystems like `/proc`, `/dev` etc., but others
don't.

To allow for a `boot.isContainer` being less overloaded, this introduces
`boot.isNspawnContainer` that is exclusively used for nspawn-specific
things. When `true`, `boot.isContainer = true;` is implied.
2025-09-21 13:26:23 +02:00
Emily 51a41ce9a1
installer/nixos-generate-config: remove broadcom_sta (#426831) 2025-07-27 05:35:35 +01:00
NullCube 9c9f467d49 installer/nixos-generate-config: remove broadcom_sta
Resolves the installer failing on devices that include this hardware, as
broadcom_sta was marked as insecure due to being unmaintained and having
active CVE's.

This commit be reverted when/if the installer has a mechanism for allowing
insecure packages.
2025-07-26 18:37:53 -07:00
Emily 8115e2b01a nixos-generate-config: prefer /dev/mapper paths for mounts
Currently, we generate `/dev/disk/by-uuid` paths for encrypted LUKS
volumes, which makes it impossible to determine that they are waiting
on a Device Mapper device at boot. Using `/dev/mapper` paths ensures
that systemd stage 1 waives its standard mount timeout for these
volumes to allow the user more time to enter the LUKS password.
2025-07-13 12:59:43 +01:00
Martin Weinelt f633ed9278
nixos/installer: enable networkmanager by default (#420923) 2025-07-04 22:21:11 +02:00
Martin Weinelt b05541933d
nixos/installer: enable networkmanager by default
This is the easiest pick for new users to get their footing on NixOS.

NetworKManager allows managing a wide variety of different network
interface types interactively and with ease. It replaces `useDHCP` since
its default profiles for Ethernet and WLAN come with DHCP enabled by
default.
2025-06-29 19:55:44 +02:00
ryunix 9feba7c2ff nixos/nixos-generate-config: remove extra indentation in flake output 2025-06-27 00:36:25 +09:00
Graham Christensen 7e7cf1ce2f nixos-generate-config: Add a flake default to the conf file 2025-06-06 10:32:55 -04:00
Will Fancher b82dbaf3ab nixos-generate-config: Fix unspecified root 2025-03-18 04:56:51 -04:00
Will Fancher 674a41e913 nixos-generate-config: Set linuxPackages_latest when ISO boots latest kernel 2025-03-16 01:38:37 -04:00
Will Fancher 6f1b070056 nixos-generate-config: Add config file 2025-03-16 01:38:37 -04:00
Pablo Ovelleiro Corral 1606ea91b4 nixos-generate-config: add --flake option
Co-authored-by: éclairevoyant <848000+eclairevoyant@users.noreply.github.com>
2025-02-18 15:37:53 +07:00
Bjørn Forsman e17e60b273 nixos-generate-config: preserve vfat filesystem mount permissions
The default is to mount these world-readable, but that's a security risk
for the EFI System Partition.

Ref https://github.com/NixOS/nixpkgs/issues/279362.
2024-04-10 19:34:07 +02:00
Luke Granger-Brown 3b8cd8ad70 installer/nixos-generate-config: correctly detect bcache
PR #256638 inadvertently introduced a bug in `nixos-generate-config` whereby it
would never put `bcache` into the `availableKernelModules` for the initrd.

This is because the `qr` operator in Perl returns a regex object, rather than
matching it; the regex object evaluates to true, making the filter expression
effectively `grep(!true, @bcacheDevices)`, which will always return an empty
list.
2024-03-26 23:32:09 +01:00
github-actions[bot] 9776723357
Merge master into staging-next 2023-11-11 18:00:58 +00:00
Anthony Roussel e30f48be94
treewide: fix redirected and broken URLs
Using the script in maintainers/scripts/update-redirected-urls.sh
2023-11-11 10:49:01 +01:00
github-actions[bot] df9eab6771
Merge staging-next into staging 2023-10-23 00:03:00 +00:00
Atemu fb602e5608 installer/nixos-generate-config: don't set powersave cpuFreqGovernor
This script would always "detect" the "powersave" governor as it is available on
practically all CPUs while the "ondemand" governor is only available on some old
CPUs.

IME the "powersave" governor barely provides any power savings but introduces
massive performance deficits, including noticable stuttering. This is not the
default experience we should offer users, even for those who use laptops.

Use the kernel default (currently "performance", CPU makers may change it in
future) instead.
2023-10-21 18:29:25 +02:00
Daniel Hill d6bf8b47ec bcachefs: 2023-06-28 -> 2023-09-29
Includes prep work for mainline bcachefs release.
2023-10-03 22:00:26 +01:00
Linus Heckemann c0f963a338 boot.initrd.services.swraid -> boot.swraid
Since the option affects both stage-1 and stage-2, it does not make
sense to keep it within the boot.initrd namespace.
2023-07-10 20:20:08 +02:00
Linus Heckemann 0b277bcc2b nixos/swraid: make entire module optional
swraid support will now only be enabled by default if stateVersion is
older than 23.11. nixos-generate-config will now generate explicit
config for enabling support if needed.
2023-07-10 16:39:35 +02:00
Robert Hensing 1350e522fa nixos-generate-config: Fix generated hostPlatform.system
While the intent of the code was correct, the system string can not be used
in the substituteAll function.

See https://github.com/NixOS/nixpkgs/issues/237216
2023-06-11 19:28:51 +02:00
Matthias Berndt cb410a8c59 Merge remote-tracking branch 'upstream/master' into mberndt123/stratis-rootfs 2023-05-17 21:47:19 -04:00
Matthias Berndt 3aa262b644 make nixos-generate-config generate stratis pool UUIDs 2023-05-15 20:48:10 -04:00
ajs124 30bea8d82d nixos/*: remove boot.grub.version 2023-05-10 21:51:26 +02:00
name_snrl 1aa8534f3e nixos/nixos-generate-config: use hostPlatform.system instead of calling nix 2023-04-26 23:51:48 +05:00
R-VdP 3078cdb780 nixos/nixos-generate-config: include new device ID for virtio_scsi
Device IDs found here:
https://devicehunt.com/view/type/pci/vendor/1AF4/device/1048
2023-04-18 18:05:53 +00:00
Sandro 603320b64f
Merge pull request #204534 from SuperSandro2000/boot-tmp 2023-04-12 21:37:47 +02:00
K900 4787ebf7ae nixos/hidpi: remove
The single option tries to do too much work, which just ends up confusing people.

So:
- don't force the console font, the kernel can figure this out as of #210205
- don't force the systemd-boot mode, it's an awkward mode that's not supported
  on most things and will break flicker-free boot
- add a separate option for the xorg cursor scaling trick and move it under the xorg namespace
- add a general `fonts.optimizeForVeryHighDPI` option that explicitly says what it does
- alias the old option to that
- don't set any of those automatically in nixos-generate-config
2023-03-21 13:29:57 +01:00
Sandro Jäckel a5d95ac5fc
nixos/tmp: move /tmp options under boot.tmp 2023-03-19 18:49:37 +01:00
Luflosi 1d65c7279c
nixos-generate-config: update microcode only on bare metal
Guest operating systems inside VMs or containers can't update the host CPU's microcode for obvious security reasons, so setting the `hardware.cpu.*.updateMicrocode` options is pointless.
2023-03-13 20:15:13 +01:00
Maëlys Bras de fer b2224764ee
nixos-generate-config: substitute nix-instantiate 2022-07-07 18:42:44 +02:00
Kirill A. Korinsky 08ddd8a5fc
nixos-generate-config: detect parallels virtualization 2022-06-29 16:01:08 +02:00
Robert Hensing 82da0794c2 nixos-generate-config: Make robust against missing newline
The substr solution assumed a newline to be present.
The new solution will not remove the newline if it goes missing in the future.

Apparently this is idiomatic perl.

Thanks pennae for the suggestion!
2022-06-21 14:37:16 +02:00
Robert Hensing fc0971f436 nixos-generate-config: nixpkgs.system -> nixpkgs.hostPlatform 2022-06-21 14:22:36 +02:00
Robert Hensing a234fb2a5b nixos-generate-config: Add nixpkgs.system to hardware-config.nix 2022-06-21 14:21:17 +02:00
Maximilian Bosch f4e5bd8064
nixos/nixos-generate-config: update comment for useDHCP 2022-05-06 16:56:47 +02:00
Maximilian Bosch 8e42949a24
nixos/nixos-generate-config: use networking.useDHCP by default
Currently we're still using scripted networking by default. A problem
with scripted networking is that having `useDHCP` on potentially
non-existing interfaces (e.g. an ethernet interface for USB tethering)
can cause the boot to hang.

Closes #107908
2022-04-30 00:30:47 +02:00
Artturin 611b8c4472 nixos/nixos-generate-config: fix specifying --root /mnt --dir adir
it should save to `$PWD/adir` instead of `/mnt/adir`
and --dir adir should save to `$PWD/adir` instead of `/adir`
2022-03-18 23:16:19 +02:00
andr1an 00487b5a87 nixos/nixos-generate-config: resolve abspath to root 2022-03-18 23:16:06 +02:00
Artturin b4adac9ba9 nixos/nixos-generate-config: move dhcpConfig from configuration.nix to hardware-configuration.nix 2022-02-09 19:35:19 +02:00
Artturin aaf13bb3bd nixos/nixos-generate-config: fix proram path replacements
btrfs-progs was made optional in 2019 c01ea27ce3
because it didn't cross-compile. it now does
2022-02-09 18:38:17 +02:00
Artturin f93a7f8b56 nixos-generate-config: automatically enable microcode updates 2021-11-15 22:28:41 +02:00
WORLDofPEACE 452f7e14d4 nixos/tools: generate an xserver config
The desktop configuration won't enable xserver.
If there's multiple desktops enabled they will now evaluate properly.
2021-02-13 18:46:01 -05:00
Victor Nawothnig 27e9328895 Support virtio_scsi devices on nixos-generate-config 2020-11-04 10:00:28 +01:00
WORLDofPEACE 99d5111246 nixos/tools: add desktopConfiguration option
We now have a GNOME ISO so it would be nice to seed that one
with configuration on how to enable it.
2020-10-12 22:03:16 -04:00
Eelco Dolstra b551f06097 nixos-generate-config: Add missing newline 2020-10-03 10:48:39 +02:00
Linus Heckemann a5d20d25eb
Merge pull request #88669 from Mic92/hidpi
nixos/hidpi: Reasonable defaults for high-density displays
2020-07-22 17:43:03 +02:00
Jörg Thalheim e943489f24
nixos-generate-config: refer to nixos-hardware 2020-06-22 23:51:08 +01:00
Jörg Thalheim 435340ed58
nixos-generate-config: enable hidpi module for displays 2020-05-24 16:32:03 +01:00