Commit graph

3311 commits

Author SHA1 Message Date
nikstur 50d0a81800 nixos/nix-store-veritysetup: init 2025-06-16 10:28:53 +02:00
Jared Baur c59d4343f9
treewide: remove Perl-based switch-to-configuration 2025-06-11 08:56:42 -07:00
K900 c9dd2063b7 Merge remote-tracking branch 'origin/master' into staging-next 2025-06-06 09:28:07 +03:00
Philip Taron 1755d9399b
nixos/networkd: update valid KeepConfiguration values (#395621) 2025-06-05 16:17:48 -07:00
nixpkgs-ci[bot] 1c8c1864d6
Merge master into staging-next 2025-06-03 18:06:20 +00:00
Masum Reza 4c902775b8
nixos/limine: make the install script more resilent (#413390) 2025-06-03 20:40:14 +05:30
nixpkgs-ci[bot] 3a906e9756
Merge master into staging-next 2025-05-31 06:05:28 +00:00
Jörg Thalheim 51ecd58047 system.etc.overlay: build erofs also locally
images in etc tends to be small in size (mostly contains symlinks)
so it's not worth it to reach out to a remote builder for that.
2025-05-30 18:52:30 +02:00
nixpkgs-ci[bot] 146a746157
Merge staging-next into staging 2025-05-30 12:07:33 +00:00
nixpkgs-ci[bot] c25ea8ef9b
Merge master into staging-next 2025-05-30 12:06:47 +00:00
Josh Hoffer 57c6e3bbe4 nixos/stage-1.init.sh: only remount bind fsType
We should not remount all filesystem types since not all filesystems
are safe to remount and some (nfs) return errors if remounted with
certain mount options.
2025-05-30 12:13:13 +05:30
Josh Hoffer 07f46bea64 nixos/stage-1.init.sh: remove trailing , from mount options 2025-05-30 12:13:13 +05:30
nixpkgs-ci[bot] aabaf9f281
Merge staging-next into staging 2025-05-29 18:06:18 +00:00
nixpkgs-ci[bot] bc2e6e0ae4
Merge master into staging-next 2025-05-29 18:05:35 +00:00
Florian Klink 9dd801dea7
nixos/systemd-initrd: honor the enable option in contents (#411800) 2025-05-29 18:06:12 +03:00
nixpkgs-ci[bot] 97fff3a232
Merge staging-next into staging 2025-05-29 12:07:37 +00:00
nixpkgs-ci[bot] 96ecef502b
Merge master into staging-next 2025-05-29 12:06:54 +00:00
Florian Klink 2d03d70e9d
nixos/systemd-stage-1: follow systemd /run propagation (#405687) 2025-05-29 12:21:50 +03:00
isabel 00b6b1ffcc
nixos/etc-overlay: mark EROFS_FS kernel configuration option as required (#365450) 2025-05-29 09:42:43 +01:00
Fiona Behrens 99da5ec2bc nixos/systemd-initrd: honor the enable option in contents
The enable attribute of `boot.initrd.systemd.contents.<name>` was
ignored for building initrd storePaths. This resulted in building
derivations for the initrd even if it was disabled.

Found while testing a to build a nixos system with a kernel without
lodable modules[0]

[0]: https://github.com/NixOS/nixpkgs/pull/411792
2025-05-28 17:10:02 +00:00
Peter Marshall 7d36daa76a
nixos/systemd-stage-1: follow systemd /run propagation
We currently bypass systemd's switch-root logic by premounting
/sysroot/run. Make sure to propagate its sub-mounts with the recursive
flag, in accordance with the default switch-root logic.

This is required for creds at /run/credentials to survive the transition
from initrd -> host.
2025-05-28 13:02:39 -04:00
nixpkgs-ci[bot] fe00466a98
Merge staging-next into staging 2025-05-28 12:08:06 +00:00
nixpkgs-ci[bot] 61b02cb4be
Merge master into staging-next 2025-05-28 12:07:03 +00:00
Florian Klink 6be6061a7c
nixos/systemd/networkd: allow passing flow control fields to link (#402587) 2025-05-28 09:39:16 +03:00
nixpkgs-ci[bot] 3f5733a8f9
Merge staging-next into staging 2025-05-26 18:06:16 +00:00
nixpkgs-ci[bot] cc7ffdded8
Merge master into staging-next 2025-05-26 18:05:25 +00:00
Jörg Thalheim 131462b962
emergencyMode, emergencyAccess: cross reference options in docs. (#410418) 2025-05-26 14:12:41 +02:00
nixpkgs-ci[bot] 8afc7d1f62
Merge staging-next into staging 2025-05-26 12:07:27 +00:00
nixpkgs-ci[bot] a5ddfccbf2
Merge master into staging-next 2025-05-26 12:06:38 +00:00
programmerlexi 2c673b6e67
nixos/limine: fix boot entry not being created properly (#410935) 2025-05-26 13:19:36 +05:30
Luj b16c62d24e
nixos/clevis: fix clevis in scripted initrd (#410661) 2025-05-26 09:04:17 +02:00
nixpkgs-ci[bot] 6650fae47a
Merge master into staging-next 2025-05-25 12:06:03 +00:00
Vladimír Čunát 3d7372384d
Merge branch 'master' into staging 2025-05-25 09:51:57 +02:00
Julien Malka 9655143028
nixos/clevis: fix clevis in scripted initrd
Fixes #389750
2025-05-25 01:34:06 +02:00
LuoChen af93b70ddc nixos/boot: add boot.tmp.useZram options 2025-05-24 23:01:41 +08:00
DavHau d5d323a907 emergencyMode, emergencyAccess: cross reference options in docs.
I was confused why I could not get an emergency access console despite setting systemd.emergencyMode=true.

Turns out there is another similar option `boot.initrd.systemd.emergencyAccess` that I should have used.

This is confusing and this change should make it more clear vie the docs of both these options.
2025-05-24 14:01:22 +07:00
nixpkgs-ci[bot] 5c675c14a4
Merge staging-next into staging 2025-05-23 17:49:42 +00:00
nixpkgs-ci[bot] 542c7ef677
Merge master into staging-next 2025-05-23 17:48:46 +00:00
John Titor 88d5e40fcb
limine, nixos/limine, nixosTests.limine: inherit pkgs.limine maintainers
also adds @programmerlexi to limine package maintainers

Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-05-23 15:06:50 +05:30
Morgan Jones ff7b4ccdff
nixos/stage-2-init: support nosuid/nodev mount options for /nix/store (#406184) 2025-05-22 19:16:54 -07:00
nixpkgs-ci[bot] c18eaf47ec
Merge master into staging-next 2025-05-22 18:05:39 +00:00
hustlerone de6905ee37 nixos/limine: tidy up the boot menu 2025-05-22 20:45:00 +05:30
nixpkgs-ci[bot] 0870c6fca2
Merge master into staging-next 2025-05-22 00:16:45 +00:00
Paul Haerle 190ee55caa
systemd-boot: improve error message if no previous systemd boot is fo… (#409073) 2025-05-22 00:54:16 +02:00
nixpkgs-ci[bot] f71fa930ff
Merge master into staging-next 2025-05-21 18:06:02 +00:00
programmerlexi 95030d7eb3 nixos/limine: don't modify boot order on bootloader update 2025-05-21 23:17:42 +05:30
programmerlexi 36ecfe6216 nixos/limine: add support for secure boot
Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-05-21 21:59:23 +05:30
nixpkgs-ci[bot] 4d9655a56c
Merge master into staging-next 2025-05-21 12:07:14 +00:00
programmerlexi a094b5d8cc nixos/limine: carefully remove files instead of nuking them 2025-05-21 15:22:45 +05:30
programmerlexi 2c7659b1ff nixos/limine: atomically copy files 2025-05-21 15:22:45 +05:30
nixpkgs-ci[bot] 7ac4ee7b2a
Merge master into staging-next 2025-05-20 18:05:35 +00:00
Jörg Thalheim b6c1663986 systemd-boot: improve error message if no previous systemd boot is found. 2025-05-20 15:39:07 +02:00
benaryorg e434130d0b
nixos/systemd: unconditional systemd-journald-audit.socket
Containers did not have *systemd-journald-audit.socket* in *additionalUpstreamSystemUnits*, which meant that the unit was not provided.
However the *wantedBy* was added without any additional check, therefore creating an empty unit with just the *WantedBy* on *boot.isContainer* machines.
This caused `systemd-analyze verify` to fail:

```text
systemd-journald-audit.socket: Unit has no Listen setting (ListenStream=, ListenDatagram=, ListenFIFO=, ...). Refusing.
systemd-journald-audit.socket: Cannot add dependency job, ignoring: Unit systemd-journald-audit.socket has a bad unit file setting.
systemd-journald-audit.socket: Cannot add dependency job, ignoring: Unit systemd-journald-audit.socket has a bad unit file setting.
```

The upstream unit already contains the following, which should make it safe to include regardless:

```ini
[Unit]
ConditionSecurity=audit
ConditionCapability=CAP_AUDIT_READ
```

For reference, this popped up in the context of #[360426](https://redirect.github.com/NixOS/nixpkgs/issues/360426) as well as #[407696](https://redirect.github.com/NixOS/nixpkgs/pull/407696).

Co-authored-by: Bruce Toll <4109762+tollb@users.noreply.github.com>
Signed-off-by: benaryorg <binary@benary.org>
2025-05-18 19:58:59 +00:00
Grimmauld aa3e5a2738
nixos/stage-2-init: remove 'readOnlyNixStore' option
The `boot.readOnlyNixStore` option can be removed,
now that the more flexible `boot.nixStoreMountOpts` option exists.
2025-05-18 12:08:03 +02:00
Grimmauld 4e440ec124
nixos/stage-2-init: support nosuid/nodev mount options for /nix/store
This is part of security-in-depth.
No suid binaries or devices should ever be in the nix store.
If they are, something is seriously wrong.
Disallowing this from a file system level should be non-breaking.
2025-05-18 12:07:10 +02:00
nixpkgs-ci[bot] 7e279a7b17
Merge master into staging-next 2025-05-18 00:18:27 +00:00
nikstur 3f4a4ffa18
nixos/etc-overlay: mount etc with nodev,nosuid (#406397) 2025-05-17 20:32:38 +02:00
Ramses c0f89cb69e
nixos/limine: substituteAll -> replaceVarsWith (#406872) 2025-05-17 20:08:31 +02:00
nixpkgs-ci[bot] 202ff56cc6
Merge master into staging-next 2025-05-17 18:04:53 +00:00
Ramses 139080c304
nixos/specialisation: escape and restrict specialisation names (#405393) 2025-05-17 19:47:05 +02:00
nixpkgs-ci[bot] 4ee3bd3150
Merge master into staging-next 2025-05-16 18:05:48 +00:00
Sandro c0cd90d343
nixos/etc: remove rogue continue (#399915) 2025-05-16 15:08:17 +02:00
Robert Hensing 3dd811c4b9 lib.types.attrNamesToTrue: unpublish temporarily
Thank you for making this change.
Unfortunately, and I take blame for this, this change to the module
system was not reviewed and approved by the module system maintainers.
I'm supportive of this change, but extending it on the staging-next
branch is not the right place.
This commit is also here to make sure that we don't run into conflicts
or other git trouble with the staging workflow.

Review:
It looks alright, but it didn't have tests yet, and it should be
considered in a broader context where the existence of this type
creates an incentive to be used in cases where the `<attr> = false;`
case is undesirable. I'd like to complement this with an type that
has `<attr> = {};` only.

My apologies for the lack of a timely and clear review. Often we
recommend to define the type outside the module system until
approved. This commit puts us back in that state.

attrNamesToTrue was introduced in 98652f9a90
2025-05-16 11:52:36 +02:00
Winter b7ea2eaa7d
nixos/kernel: Module inclusion improvements (#375975) 2025-05-16 01:44:53 -04:00
Arian van Putten 871526be1f
nixos/image/repart: Use own assertions / warnings. (#406940) 2025-05-15 19:14:53 +02:00
Will Fancher 96fb55514f nixos/stage-1: Add option for allowing missing modules 2025-05-15 00:00:56 -04:00
Will Fancher 028b3e1411 nixos: Use common modulesClosure in scripted and systemd initrd 2025-05-15 00:00:56 -04:00
Will Fancher 98652f9a90 nixos/kernel: Allow controlling modules with attrsets 2025-05-15 00:00:56 -04:00
Vladimír Čunát bf7544999c
Merge master into staging-next 2025-05-14 08:12:15 +02:00
Will Fancher 4b0d1225f5 lib/asserts: Factor out NixOS's toplevel assertion / warning logic. 2025-05-14 01:21:10 -04:00
nat e51e0da386
nixos/limine: substituteAll -> replaceVarsWith 2025-05-13 23:14:43 +02:00
Berk D. Demir e4bf5ce70d nixos/activation: Fix shellcheck test failure
lib/test.nix relies on `fileset.toSource` which creates a source dir
with the files of interest. `testers.shellcheck` passes all the files in
the source dir to shellcheck. The issue is related to relative path
sourcing, i.e. `source ./lib.sh` where shellcheck cannot make any
assumptions about the working directory.

Options were:
1) Disable this warning with a directive
   Prior disabling in the tree:
    - pkgs/tools/nix/info/info.sh
    - nixos/modules/testing/test-instrumentation.nix

2) Set source-path to SCRIPTDIR with a directive
   https://github.com/koalaman/shellcheck/wiki/Directive#source-path

   Even though we don't enable external script following for shellcheck
   with `-x` flag given every file in the source dir is passed, this
   directive seems to capture the intent to help shellcheck a bit
   better.

Went with option 2.
2025-05-12 09:58:28 -07:00
r-vdp a2f3516c24
nixos/etc-overlay: mount etc with nodev,nosuid 2025-05-12 10:35:18 +02:00
nixpkgs-ci[bot] 673efed879
Merge master into staging-next 2025-05-11 00:17:35 +00:00
Martin Weinelt 9da9474d63
nixos/boot/tmp: introduce adaptive huge memory pages (#404514) 2025-05-11 01:23:32 +02:00
Florian Klink 180f5a2593
nixos/systemd-initrd: deprecate strip (#404512) 2025-05-10 19:11:16 +03:00
Colin 62cab5dbe8
pkgs/buffybox: 3.2.0-unstable-2025-03-16 -> 3.3.0-unstable-2025-05-06 (#403179) 2025-05-09 02:04:39 +00:00
Gerg-L 98313e2b81
nixos/systemd-initrd: deprecate strip
It only saved ~1MiB of initramfs size, but caused a few issues
like unloadable kernel modules.
2025-05-08 19:08:14 -04:00
hustlerone 90ff6dc49e nixos/unl0kr: fix touchpads 2025-05-09 00:29:43 +02:00
toborwinner 2b9fc0ccc5
nixos/specialisation: escape and restrict specialisation names
Prevent the specialisation names from containing a forward slash.
Also escape them to allow for spaces in specialisation names.
2025-05-09 00:10:54 +02:00
PAEPCKE, Michael b8eb81e873
nixos/boot/tmp: introduce adaptive huge memory pages 2025-05-05 22:52:02 +00:00
Yureka 3b42616f4b nixos/initrd-ssh: include sshd-auth binary in initrd 2025-05-05 17:23:47 +02:00
Charlie Moog 5781ef6de9
nixos/systemd/networkd: allow passing flow control fields to link 2025-05-03 18:18:30 +00:00
Sandro 55e8dc37a3
nixos/luksroot: remove useless $new_k_luks (#115832) 2025-04-30 16:51:33 +02:00
nikstur bf2bc08b37
repart: Enable discard option (#397906) 2025-04-28 13:34:32 +02:00
Paul Haerle 86a1af8a7b
nixos/systemd: clarify what enableStrictShellChecks checks (#401460) 2025-04-27 14:15:15 +02:00
Scott Edlund 02555cd0bd nixos/systemd: clarify what enableStrictShellChecks checks
the specifics of this option are in the release notes, but bring
them into the documentation.
2025-04-26 01:46:12 +08:00
Raito Bezarius 139bfb5b5e nixos/system/activation/bootspec: generalize the bootspec tooling package
After RFC-0125 implementation, Determinate Systems was pinged multiple
times to transfer the repository ownership of the tooling to a
vendor-neutral repository.

Unfortunately, this never manifested. Additionally, the leadership of
the NixOS project was too dysfunctional to deal with this sort of
problem. It might even still be the case up to this day.

Nonetheless, nixpkgs is about enabling end users to enact their own
policies. It would be better to live in a world where there is one
obvious choice of bootspec tooling, in the meantime, we can live in a
world where people can choose their bootspec tooling.

The Lix forge possess one fork of the Bootspec tooling:
https://git.lix.systems/lix-community/bootspec which will live its own
life from now on.

Change-Id: I00c4dd64e00b4c24f6641472902e7df60ed13b55
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2025-04-24 18:22:02 +02:00
Nico Felbinger e0d1b49a46
chore: move meta option to top level in many modules 2025-04-19 18:27:48 +02:00
Sandro Jäckel 484b00be20
nixos/etc: remove rogue continue 2025-04-19 03:01:40 +02:00
Martin Weinelt fbf76bf72b
make-initrd-ng: Restore stripped file permissions (#398396) 2025-04-13 18:11:19 +02:00
Will Fancher c9ea864d6f nixos/shutdown: Create /run/initramfs with mode 0700 2025-04-13 12:02:16 -04:00
Markus Sütter c6476ca119 repart: Enable discard option
systemd-repart can be configured to not automatically issue BLKDISCARD commands
to the underlying hardware.

This PR exposes this option in the repart module.
2025-04-11 12:46:50 +02:00
Hugo Lageneste 1599c37a6b nixos/luksroot: remove useless $new_k_luks
Remove the variable new_k_luks used only once in the code.
2025-04-04 23:39:29 +02:00
Jared Baur d8f9c63512
nixos/networkd: update valid KeepConfiguration values
These changed with the release of systemd v257 from "dhcp*" to
"dynamic*".
2025-04-02 16:27:33 -07:00
nixpkgs-ci[bot] d05ee1c1cb
Merge staging-next into staging 2025-04-02 16:38:11 +00:00
Silvan Mosberger e52d633a63 Merge remote-tracking branch 'upstream/staging-next' into staging 2025-04-02 18:30:54 +02:00
Mikael Voss 045fbc389f
nixos/tmpfiles: properly escape argument option
The systemd.tmpfiles.settings.<name>.<path>.<type>.argument option may
contain arbitrary strings. This could allow intentional or unintentional
introduction of new configuration lines.

The argument field cannot be quoted, C‐style \xNN escape sequences are
however permitted. By escaping whitespace and newline characters, the
issue can be mitigated.
2025-04-02 13:23:42 +02:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
nixpkgs-ci[bot] d5f30d9d8a
Merge staging-next into staging 2025-03-24 12:07:10 +00:00
Luj e21904681e
nixos/systemd-boot: strip newline from machine-id (#375298) 2025-03-24 11:06:53 +01:00
nixpkgs-ci[bot] a9379697ea
Merge staging-next into staging 2025-03-22 18:05:14 +00:00
Weijia Wang 7bce6fbf11
nixos/limine: Fix reading generations for primary profile and specialisations (#391210) 2025-03-22 18:23:02 +01:00
nixpkgs-ci[bot] fb67c77244
Merge staging-next into staging 2025-03-21 07:09:56 +00:00
Will Fancher c983091366
nixos/sysusers: respect per user .enable (#388551) 2025-03-20 20:25:49 -04:00
isabel 2c836c5054
nixos/sysusers: respect per user .enable 2025-03-20 20:43:00 +00:00
nixpkgs-ci[bot] 47fbdfd4fc
Merge staging-next into staging 2025-03-20 00:16:05 +00:00
Angelo Bulfone 9ed29c65a4
nixos/limine: Fix reading generations and specialisations
Previously, all generations for the primary system profile
read their data from the currently active one rather than
their own path, and specialisations in general all used
their parent bootspec rather than their own. This fixes both issues.

This commit still uses the parent path's build date for
specialisations, but this is more minor issue and the times
shouldn't be meaningfully different in most cases anyways.
2025-03-19 15:19:41 -07:00
Will Fancher ecbf53f525
nixos/systemd: conditionally leave out some upstream units (#374214) 2025-03-19 16:58:14 -04:00
Will Fancher b15e9e7d3d
nixos/initrd: add extraFirmwarePaths option (#391166) 2025-03-19 16:51:26 -04:00
Jared Baur dad880d6bf
nixos/systemd: conditionally leave out some upstream units
Some upstream systemd units are conditionally installed into the systemd
output, so we must make sure the feature that enables their installation
is enabled on our side prior to trying to use them.
2025-03-19 08:14:48 -07:00
nixpkgs-ci[bot] 08c1a45314
Merge staging-next into staging 2025-03-19 12:06:32 +00:00
Benedikt Ritter deb045e057
initrd: implement panic-on-fail interpreterless 2025-03-19 10:23:46 +01:00
Jared Baur ea116654aa
nixos/initrd: add extraFirmwarePaths option
(cherry picked from commit 488d4316b9e1510c9b4a2eeb8d7e2cc66839a1fc)
2025-03-18 20:39:52 -07:00
nixpkgs-ci[bot] dbbed7e029
Merge staging-next into staging 2025-03-18 00:15:57 +00:00
programmerlexi 1a830fe9d9 nixos/limine: fix the install script 2025-03-18 01:06:55 +05:30
Rane 2cc1d33489
nixos/limine: cast partition index to string (#390732) 2025-03-18 01:01:15 +05:30
Philip Taron f4dd3ba6e0
systemd: make systemd-ssh-generator work (#372979) 2025-03-15 21:59:59 -07:00
Florent Charpentier 631bed6ed9 nixos/systemd-repart: add support for repeating settings
fix https://github.com/NixOS/nixpkgs/issues/389478
2025-03-14 19:43:28 +01:00
Marie Ramlow aab69d7f19 nixos/systemd: include sshd in PATH if openssh is enabled
This enables systemd-ssh-generator to find the sshd binary.
2025-03-14 18:34:50 +01:00
Florian Klink a8dc55f40b
nixos/logind: add "sleep" option to logindHandlerType (#388792) 2025-03-12 17:17:00 +02:00
nixpkgs-ci[bot] 9a807b1916
Merge master into staging-next 2025-03-11 17:36:38 +00:00
Pol Dellaiera c39e50acb0
nixos/limine: init module (#386368) 2025-03-11 14:09:50 +01:00
SebastianStork e0258ad135
nixos/logind: add "sleep" option to logindHandlerType
The "systemctl sleep" command was added in systemd v256.
2025-03-10 19:44:27 +01:00
John Titor f597c68e7b
nixos/boot/systemd: enable tracefs
tracefs is a special-purpose filesystem in Linux used for tracing filesystem and kernel operations.

This was added to the kernel back in 2015 to replace debugfs. For security reasons, some system do not mount debugfs at all. Tracefs reduces the attack surface by allowing to trace without mounting debugfs. Additionally it provides features not supported by debugfs (such as calls for mkdir and rmdir

Debian and Arch Linux both enable this by default.
RHEL 8 and later, they enable tracefs by default.

Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-03-10 22:27:41 +05:30
Connor Baker 871cda0b06
testers.shellcheck: refactor, update docs, and simplify tests (#385940) 2025-03-07 20:53:33 -08:00
Connor Baker cd7df192e3 treewide: add name argument to calls to testers.shellcheck 2025-03-08 00:15:22 +00:00
programmerlexi 12779dc091
nixos/limine: init module
Co-Authored-By: Gabriel Waksmundzki <czapek1337@gmail.com>
2025-03-06 08:05:08 +01:00
Samuel Dionne-Riel 6ec6eae586
Revert "nixos/grub: generate BLS entries" 2025-02-28 14:30:10 -05:00
rnhmjoj 435a72e469
nixos/grub: generate BLS entries 2025-02-28 09:51:20 +01:00
Peder Bergebakken Sundt 527be14321 nixos/doc: convert links to manpages 2025-02-21 16:31:09 +01:00
nixpkgs-ci[bot] 3a870eb511
Merge master into staging-next 2025-02-19 18:04:49 +00:00
Jörg Thalheim 55b39e42a6
install-grub: add missing rmtree (#383269) 2025-02-19 21:53:51 +07:00
nixpkgs-ci[bot] a8eabdcf7f
Merge master into staging-next 2025-02-19 11:19:10 +00:00
Ramses 9abef1cee8
switch-to-configuration-ng: don't block when the lockfile is already locked (#382797) 2025-02-19 11:07:33 +01:00
Jörg Thalheim 39dd19122f install-grub: add missing rmtree 2025-02-19 14:33:46 +07:00
nixpkgs-ci[bot] 9bd398d5e9
Merge master into staging-next 2025-02-18 12:05:57 +00:00
Michele Guerini Rocco d05074f981
nixos/getty: only include if config.console.enable == true (#363533) 2025-02-18 11:44:42 +01:00
nixpkgs-ci[bot] 83f409d731
Merge master into staging-next 2025-02-18 06:04:52 +00:00
Jörg Thalheim 5be6db6b3d
grub modernize (#374844) 2025-02-18 13:03:24 +07:00
nixpkgs-ci[bot] 71e949e746
Merge master into staging-next 2025-02-18 00:14:29 +00:00
Fernando Rodrigues cf4c8e97ad
nixos/networkd: add new options introduced in systemd 257
The Wireguard public key can now be read from a file.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-02-17 21:51:40 +00:00
r-vdp 125edf8424
switch-to-configuration: don't block on flock, see 7a56ddaf9d 2025-02-17 13:14:25 +01:00
nixpkgs-ci[bot] fc7fa5f568
Merge master into staging-next 2025-02-17 00:15:35 +00:00
Arian van Putten 3835432751
systemd-repart: Enable custom --empty flags in initrd (#373414) 2025-02-16 20:03:50 +01:00
K900 daadcbdaac nixos/systemd-stage-1: explicitly add pkgs.runtimeShell dependency
Because it's no longer pkgs.bash (which is interactive), and
can be something else on other platforms anyway.
2025-02-16 19:42:14 +03:00
nixpkgs-ci[bot] 43a5de6cbb
Merge master into staging-next 2025-02-14 12:05:56 +00:00
Maximilian Bosch 4eccb53550
nixos/tmpfiles: fix docs
Closes #381822

Apparently, I swapped `path` and `tmpfiles-type` in
2be50b1efe. Sorry about that 🫠

Also giving
`systemd.tmpfiles.settings.<config-name>.<path>.<tmpfiles-type>.type` a
better default in the manual than `‹name›`, i.e. `‹tmpfiles-type›` so
that it corresponds to the placeholders in the attribute path.
2025-02-14 09:42:43 +01:00
Jared Baur 3de7bccd4a
nixos/systemd-boot: strip newline from machine-id
To make each line in the entry file consistent, strip the newline from
the machine-id content.
2025-02-13 18:52:14 -08:00
Wolfgang Walther b19d0f6d3d
treewide: replace substituteAll with replaceVars 2025-02-10 22:51:56 +01:00
Arian van Putten 587efe0fd0
Unbork journals audit logs and introduce audit option (#379629) 2025-02-10 12:09:32 +01:00
Arian van Putten ff78e34e0b services/journald: introduce audit option
We default this option to null ; which is different
from upstream which defaults this to true.

Defaulting this to true leads to log-spam in /dev/kmesg
and thus in our opinion is a bad default https://github.com/systemd/systemd/issues/15324
2025-02-07 15:58:19 +01:00
Arian van Putten 13b1062730 services/journald: re-enable systemd-journald-audit.socket
This was broken due to https://github.com/systemd/systemd/pull/25687
but we never noticed.
2025-02-07 14:14:53 +01:00
therainisme 0a12b8d03d
systemd: fix typo in boot.kernelParams (hierachy → hierarchy) 2025-02-07 12:06:23 +08:00
Jörg Thalheim b29c6f5a4a
stage-2-init: fix false positives for RO Nix store mounts (#375257) 2025-02-02 08:58:03 +07:00
nikstur 2442d7afa9 nioxs/etc: improve docs for file ownership 2025-02-01 22:37:46 +01:00
Ramses 823a05829f
nixos/activation: pass the action as an argument to the pre-switch-checks (#377526) 2025-01-30 11:25:33 +01:00
Franz Pletz ca0a9a0ed6
nixos/grub: Remove > from submenu title, unbreak grub-reboot (#284987) 2025-01-29 09:23:46 +01:00
Wolfgang Walther b9ea481784
nixos/systemd-boot: replace substituteAll with replaceVarsWith 2025-01-28 22:30:26 +01:00
r-vdp 713607abea
nixos/activation: document the arguments that are passed to the pre-switch-check script 2025-01-28 12:00:10 +01:00
r-vdp e6bc540ce0
nixos/activation: pass the action as an argument to the pre-switch-checks
This allows for instance to reject switching into a configuration, while
still allowing to reboot into that same configuration.

This can be useful for instance to reject switching to a configuration
with a new systemd major version, but setting that same configuration as
the new boot default with `switch-to-configuration boot` is fine.
2025-01-28 11:40:38 +01:00
Peder Bergebakken Sundt fd60375c7a nixos/timesyncd: strip man: prefix from manpage links 2025-01-27 02:47:02 +01:00
Peder Bergebakken Sundt 75b2b7e946 nixos/*: undo manual linking to known manpage urls
Made with:

jq <doc/manpage-urls.json 'to_entries[] | "rg -F \"[\(.key)](\(.value))\" nixos/ -l | xe sd -F \"[\(.key)](\(.value))\" \"{manpage}`\(.key)`\""' -r  | tr \" \' | bash -x

(requires ripgrep, sd and xe)
2025-01-27 02:47:02 +01:00
Peder Bergebakken Sundt 953f72e76e nixos/*: tag manpage references 2025-01-27 02:47:01 +01:00
r-vdp 73f3fe4839
nixos/activation: log output from pre-switch checks on stderr 2025-01-23 15:51:40 +01:00
r-vdp 113dbd79de
nixos/activation: improve preSwitchChecks
A couple of improvements:

1. Avoid the generally discouraged apply argument to options, as it has
   quite weird semantics
2. Avoid issues when a user calls a preSwitchCheck `script`, which
   would've been silently overridden by the existing implementation.
   Reliance on a special attribute name like that is bound to lead to a
   very-hard-to-debug problem for someone at some point
3. Use writeShellApplication so that the preSwitchChecks are checked by
   shellcheck and and so that they run with basic bash guardrails
4. Fix shellcheck issue (testing the value of $?)
5. Add a positive preSwitchCheck to the nixos test, to make sure that
   that works as intended
2025-01-23 15:51:37 +01:00
Morgan Jones 2f3a80c96f
stage-2-init: fix false positives for RO Nix store mounts
We need to take the "top" mount instead of any mount, which is the last
line printed by findmnt. Additionally, make the regex more strict, so we
don't select mount options ending in ro (like `errors=remount-ro` from
ext4, or overlay paths ending in 'ro') and accidentally leave the Nix
store RW after boot.
2025-01-20 00:27:18 -08:00
Yureka 3b6f658130
init-script-builder: fix build (#375160)
Change-Id: I244160844aad5fcfcab323dd721cfd87e4b8ddc0
2025-01-20 08:29:57 +01:00
Jörg Thalheim 33c2472b69 nixos/install-grub: don't use bare file handles and 3 argument open
this is not best practice perl since a long time.

<!-- ps-id: 225e1b18-348c-412f-8ecd-394f3ba9a32d -->
2025-01-18 17:33:53 +01:00
Jörg Thalheim 8d5abcd1bb nixos/install-grub: use more modern make_path
mkpath is a legacy interface.

<!-- ps-id: 0f1e0583-9cc5-4006-a4a2-fd413fe8117e -->
2025-01-18 17:33:53 +01:00
nixpkgs-ci[bot] 31193d78d8
Merge master into staging-next 2025-01-16 18:04:20 +00:00
WilliButz bc5b78f993
nixos/systemd-tmpfiles: fix ordering of systemd-tmpfiles-setup-sysroot
Prior to this change a service failure would occur when this tmpfiles
service did not finish fast enough and receive a SIGTERM from systemd.
Additionally, `initrd-nixos-activation` is already ordered with
`After=initrd-switch-root.target`.
2025-01-15 15:43:36 +01:00
github-actions[bot] 44e4abfaf6
Merge master into staging-next 2025-01-14 18:04:33 +00:00
r-vdp e5b0c411a4
nixos/etc-overlay: fix chmod call in activation script
Fixes #373691
2025-01-14 13:55:35 +01:00
phaer d2cadf484c repart: Enable custom --empty flags in initrd
By default, systemd-repart refuses to act on empty disk devices, i.e.
those without any existing partition table for safety reasons.

This behaviour can be customized via the `--empty` flag, which we now
expose via the module system. This makes to partition empty disks
on first boot.
2025-01-13 12:13:19 +01:00
github-actions[bot] 74a6c68160
Merge master into staging-next 2025-01-12 18:04:11 +00:00
Christian Kögler 40932c9afa
nixos/luksroot: Check if the device was opened while reading password (#369627) 2025-01-12 14:25:08 +01:00
github-actions[bot] 507f7fe91e
Merge master into staging-next 2025-01-12 12:05:15 +00:00
Ramses d24ca4701f
nixos/etc-overlay: make the etc overlay compatible with nixos-enter and nixos-install (#364239) 2025-01-12 09:05:57 +01:00
K900 914d17e050 nixos/boot/loader/generic-extlinux-compatible: fix eval on cross as well 2025-01-11 20:47:19 +03:00
K900 fbb4d057d1 nixos/boot/loader/generic-extlinux-compatible: fix eval 2025-01-11 20:42:58 +03:00
K900 350a060f1d Merge remote-tracking branch 'origin/master' into staging-next 2025-01-09 22:02:14 +03:00
Julien Malka 851f7fc119
nixos/clevis: do not use systemd-udev-settle (#372374) 2025-01-09 14:58:13 +01:00
rnhmjoj 2b19079b86
nixos/clevis: do not use systemd-udev-settle
See https://github.com/NixOS/nixpkgs/issues/73095 for motivations.
In this case we can just use tpm2.target (available since systemd 256).
2025-01-09 14:23:38 +01:00
github-actions[bot] ded5a5e552
Merge master into staging-next 2025-01-09 00:14:35 +00:00
piegames 31777a589c
More string fixes (#367757) 2025-01-08 20:12:26 +01:00
Andreas Fuchs ad55e1a1ef Make systemd-resolved's config file a reload trigger
It is documented to re-read its configuration file upon reload, so
we can simply reload it instead of restarting the whole daemon.
2025-01-08 13:38:04 -05:00
Andreas Fuchs 0c5719fe0e Don't stop systemd-{networkd,resolved,udevd} on config switch
These daemons should not be stopped, as they're foundational to a
proper functioning of the system. When switching configurations, they
only need a restart instead of that stop/start cycle.
2025-01-08 13:05:27 -05:00
piegames dd7d5339f7 treewide: Fix incorrect string indentations 2025-01-07 19:49:28 +01:00
K900 9e51fd8b02 Merge remote-tracking branch 'origin/master' into staging-next 2025-01-06 21:13:31 +03:00
Will Fancher fd8696a178 nixos/systemd-stage-1: Fix FIDO2 udev rules
Fixes #368856
2025-01-06 11:41:39 -05:00
K900 1d9d206c4e Merge remote-tracking branch 'origin/staging-next' into staging 2025-01-05 00:25:30 +03:00
Will Fancher 15be453e9a
switch-to-configuration: Better handling of socket-activated units (#359724) 2025-01-04 11:51:21 -05:00
K900 936f4e016d Merge remote-tracking branch 'origin/staging-next' into staging 2025-01-02 19:21:56 +03:00
Julien Malka fa99ba3c13
nixos/systemd-boot: Don't write to /etc/machine-id (#347493) 2025-01-02 11:47:20 +01:00
github-actions[bot] 3588b4d239
Merge staging-next into staging 2024-12-31 18:04:49 +00:00
Christian Kögler 6b720e5697
nixos/etc-activation: only assert for 6.6 kernel in switchable systems (#364870) 2024-12-31 16:46:17 +01:00
github-actions[bot] d8e41027cf
Merge staging-next into staging 2024-12-31 12:05:50 +00:00
Christian Kögler 1c9a0c2c1b
nixos/networkd: add RequestAddress to network sectionDHCPv4 (#366864) 2024-12-31 11:22:15 +01:00
Vladimir Panteleev a5cc2d090e nixos/luksroot: Check if the device was opened while reading password
Helps the following situation:

- SSH in initrd is enabled

- NixOS is waiting for a password to be typed at the console (or
  provided via cryptsetup-askpass)

- The user logs in via SSH, but instead of running cryptsetup-askpass,
  they run "cryptsetup open" directly (because they don't know that
  they need to use NixOS's cryptsetup-askpass script, or because they
  want to use a non-trivial unlocking method that is not natively
  supported by this module)

Currently, in the above situation, NixOS will keep waiting for a
password to be entered even though the device is already unlocked. If
a password is entered, it will print a confusing "already exists"
error and keep asking for the same password.

We can improve on this by simply checking if the device is already
unlocked in our read loop. In this case, we don't need to do anything
other than return from the function and continue booting.
2024-12-31 09:21:25 +00:00
github-actions[bot] ec149a86e5
Merge staging-next into staging 2024-12-31 00:14:41 +00:00
Will Fancher 0465e2ef7c
nixos/plymouth: Respect plymouth.enable=0 in scripted stage 1 (#355601) 2024-12-30 13:33:23 -05:00
Will Fancher 629c936fd2 nixos/plymouth: Respect plymouth.enable=0 in scripted stage 1
Removing the splash param only causes plymouth to display console
output by default; it still runs. Systemd stage 1 respects this flag
due to unit conditions preventing plymouth from even running. So this
brings parity to scripted stage 1.
2024-12-30 13:06:00 -05:00
github-actions[bot] e7344062a5
Merge staging-next into staging 2024-12-30 12:06:26 +00:00
Wolfgang Walther 255012c708
nixosTests.etc: fix with structuredAttrs
The NIX_ATTRS_SH_FILE needs to be available visible inside the
fakechroot environment, so that we can load it for structuredAttrs
support.
2024-12-29 18:36:48 +01:00
Lucy 8a1561bba6 doc: Add warning for configuration file copy in flake systems 2024-12-29 10:39:46 +01:00
K900 24c287ca64 Merge remote-tracking branch 'origin/staging-next' into staging 2024-12-26 10:09:36 +03:00
Franz Pletz 354e6458a9
nixos/networkd: add NetLabel & NFTSet options (#367615) 2024-12-26 04:15:11 +01:00
github-actions[bot] cf45abc720
Merge staging-next into staging 2024-12-24 06:05:30 +00:00
Will Fancher 08b6cf5430
(pkgs, nixos)/unl0kr - update to accomodate upstream changes (#362825) 2024-12-23 20:08:39 -05:00
hustlerone 66e4c2103d pkgs/unl0kr: superseded by pkgs.buffybox
nixos/unl0kr: accomodate for the future
2024-12-23 19:07:26 -05:00
Franz Pletz 18a943798a
nixos/networkd: add NetLabel & NFTSet options 2024-12-23 12:29:58 +01:00
K900 81932cf82a Merge remote-tracking branch 'origin/staging-next' into staging 2024-12-20 21:34:46 +03:00
Arne Keller e4e994e3fc
nixos/luksroot: Exit if EOF detected in cryptsetup-askpass (#298592) 2024-12-20 19:15:58 +01:00
FlafyDev 40086fb0ea nixos/networkd: add RequestAddress to network sectionDHCPv4 2024-12-20 18:22:47 +02:00
github-actions[bot] 3529967f0f
Merge staging-next into staging 2024-12-18 12:06:30 +00:00
Florian Klink b2e99477cd
nixos/systemd: don't require network-online.target for multi-user.taget v2 (#365809) 2024-12-18 09:52:38 +02:00
github-actions[bot] 74b55d7c5b
Merge staging-next into staging 2024-12-18 06:05:46 +00:00
Logan Attwood 6c324710e3 nixos/networkd: expose RapidCommit in DHCPv4 network unit section
Disabling this option is required to obtain a DHCPv4 lease from
some old/misconfigured DHCP servers. This was already exposed for
DHCPv6.
2024-12-18 01:03:54 -04:00
r-vdp df7c405f32
nixos/etc-overlay: always create the metadata mountpoints in /run
This avoids the dependence on the presence of /tmp, which causes issues
with nixos-install
2024-12-17 00:18:43 +01:00
r-vdp 2187d1970e
nixos/etc-overlay: make the etc overlay compatible with nixos-enter and nixos-install
When using nixos-enter (and so also nixos-install) on a system with etc-overlay enabled,
he activation script gets called directly, and there is no systemd running.
This violates a couple of assumptions in the etc-overlay activation script which
assumed that it only ever ran when switching into a new generation and that
the very first /etc would always have been set up by the systemd initrd.

As more and more things are being moved into systemd components (initrd services,
mount units, tmpfiles, etc), I think that it is going to become increasingly
difficult to stay compatible with these tools, but at least for now there is
no real alternative and so we probably want to be able to install systems
with etc-overlay enabled.
2024-12-17 00:18:43 +01:00
rnhmjoj 2370696dff
nixos/systemd: don't require network-online.target for multi-user.target v2
This is another attempt at 62f30634 after the original change was reverted in
0d85bf0e because NetworkManager and other tests were broken.
2024-12-16 18:12:47 +01:00
Moritz Sanft 7fb2f407c0
nixos/getty: only include if config.console.enable
This makes it so that the getty units are only included if
`config.console.enable` is set to `true`. Previously, they would be
included, but disabled in that case, which is unnecessary.
2024-12-16 08:45:10 +01:00
andre4ik3 250359a4d5
nixos/etc-overlay: mark EROFS_FS kernel configuration option as required 2024-12-16 02:20:02 +04:00
Wolfgang Walther e58e0c158e
various: replace substituteAll with replaceVarsWith
This covers cases which need to use replaceVarsWith because the use
isExecutable = true.
2024-12-15 13:35:30 +01:00
misuzu b8be6313dc
nixos/activation-script: check rmdir in usrbinenv (#264523) 2024-12-14 13:28:42 +02:00
Moritz Sanft bf2f6de39d
nixos/etc-activation: only assert for 6.6 kernel in switchable systems
The assertion is based on the availability of `move-mount-beneath`, which is only used in re-activation logic for switchable systems. Systems that have `system.switch.enable == false` should be allowed to user older kernels.
2024-12-13 12:13:34 +01:00
Arne Keller 8bbf8450e4
extlinux-conf-builder: don't emit MENU when timeout is zero (#318778) 2024-12-12 16:31:02 +01:00
WilliButz 58df438b47
nixos/systemd-tmpfiles: use types.attrsWith for settings (#363939) 2024-12-12 15:54:31 +01:00
Maximilian Bosch 2be50b1efe
nixos/systemd-tmpfiles: use types.attrsWith for settings
That way it's way easier to derive from the manual which key is used for
what exactly.
2024-12-12 13:48:39 +01:00
misuzu 21e39e915f
system/activation: mention deps attr in activationScripts example (#363915) 2024-12-11 20:01:19 +02:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Arne Keller 9ad61cfc19
nixos/plymouth: add support for logo in catppuccin (two-step) theme (#304045) 2024-12-10 18:43:49 +01:00
phaer df8e6f7487 system/activation: mention deps attr in activationScripts example
As it helps making deps easier to discover - as we don't currently
render submodule options in the module correctly - and is arguably
more technical correct: When using nixos-install to install nixos
into a chroot in i.e. /mnt, there's no gurantee that /mnt/dev exists
before the specialfs phase ran.
2024-12-10 14:17:09 +01:00
Jörg Thalheim 1ac98af94b
etc-overlay: mount the metadata image read-only (#360756) 2024-12-09 20:10:00 +01:00
Colin 52643c64cd nixos/unl0kr: add a package option 2024-12-04 20:13:08 +00:00
Franz Pletz f9f7d7b58c
nixos/networkd: use upstream wait-online@ unit (#360319) 2024-12-03 21:40:30 +01:00
Philip Taron 898a5023f3
nixos/boot: merge to maintain commit signatures 2024-12-02 08:58:37 -08:00
Philip Taron 548eb2776d
nixos/boot: remove lib.mdDoc from boot.modprobeConfig.useUbuntuModuleBlacklist 2024-12-02 08:58:27 -08:00
misuzu 4b0caba2c5
nixos/activation, switch-to-configuration-ng, doc: improve NIXOS_LUSTRATE installation experience (#349049) 2024-12-01 19:16:26 +02:00
r-vdp 7d6602e7de
etc-overlay: mount the metadata image read-only
On recent kernels (> 6.12 ?) we get the following warning otherwise:
`mount: /tmp/nixos-etc-metadata.aHpRhO5sC4: WARNING: source write-protected, mounted read-only.`
2024-12-01 13:44:55 +01:00
Franz Pletz 357fff0f44
nixos/networkd: allow configuring RTTSec for CAKE qdisc (#285737) 2024-11-30 07:25:54 +01:00
Franz Pletz 0d48c50f4b
nixos/networkd: use upstream wait-online@ unit
Use the upstream unit for systemd-networkd-wait-online@.service and fix
the spelling.
2024-11-30 07:15:46 +01:00
Franz Pletz 18cf9ad14b
nixos/networkd: fix eval
Broken by #330662.
2024-11-30 07:08:18 +01:00
Franz Pletz e383460f09
nixos/networkd: add dhcpServerConfig.PersistLeases option (#353189) 2024-11-30 06:46:51 +01:00
Franz Pletz e5a4cc81ab
nixos/networkd: add some new options in systemd 256 (#330662) 2024-11-30 06:44:55 +01:00
Andreas Fuchs 1fed2312e7 Add X-NotSocketActivated logic to switch-to-configuration.pl, as well 2024-11-29 09:53:10 -05:00
Andreas Fuchs bf9c6c9861 switch-to-configuration-ng: Better handling of socket-activated units
Previously, if any unit had a socket associated with it, stc-ng
counted it as "socket-activated", meaning that the unit would get
stopped and the socket get restarted. That can wreak havoc on units
like systemd-udevd and systemd-networkd.

Instead, let units set the new flag notSocketActivated, which sets a
boolean on the unit indicating to stc-ng that the unit wants to be
treated like any other non-socket-activated unit instead. That will
stop/start or restart these units on upgrades, without unnecessarily
tearing down any machinery that the system needs to run.
2024-11-27 21:36:09 -05:00
Wolfgang Walther d232880c20
various: remove left-over rtc_cmos rootModule
This is not needed anymore after
65a50ea453.
2024-11-26 22:02:46 +01:00
Sandro 8e82ef5df1
nixos/binfmt: add option addEmulatedSystemsToNixSandbox (#354533) 2024-11-26 16:35:42 +01:00