Commit graph

2835 commits

Author SHA1 Message Date
Wolfgang Walther 5a0711127c
treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Wolfgang Walther 62fe016519
treewide: run treefmt with mdcr/nixfmt 2025-07-24 13:52:31 +02:00
Grimmauld 248c463f69
nixos/tmpfiles: explicitly set RestrictSUIDSGID = false
This ensures the tmpfiles resetup service has permissions
to create suid/sgid files, even if `DefaultRestrictSUIDSGID`
is set in system.conf. This is required, as tmpfiles
are used to e.g. set file permissions on the journal
directory.`DefaultRestrictSUIDSGID` is a new feature
coming in systemd 258 [1].

[1] https://github.com/systemd/systemd/pull/38126
2025-07-20 12:40:26 +02:00
nixpkgs-ci[bot] 0ac23e27dd
Merge staging-next into staging 2025-07-18 18:06:01 +00:00
nikstur 3fd41447c7
nixos/systemd/repart: add extraArgs option and Encrypt=tpm2 test (#422511) 2025-07-18 16:52:18 +02:00
nixpkgs-ci[bot] abbe5cd65f
Merge staging-next into staging 2025-07-18 00:18:34 +00:00
Franz Pletz 71064c4808
nixos/systemd: fix run0 failing to run commands (#419588) 2025-07-17 22:18:10 +02:00
Florian Klink 27752d2b39
systemd: add sysupdated (#424101) 2025-07-17 02:04:13 +02:00
Jared Baur 996cc69171
nixos/sysupdate: add jmbaur as maintainer 2025-07-15 09:09:36 -07:00
Jared Baur 7b981efa88
nixos/sysupdate: add support for sysupdated/updatectl 2025-07-15 09:09:32 -07:00
sanana 6baed48380 limine-install: fix profile enumeration
Fixes #425158.
2025-07-15 13:49:05 +05:30
Jared Baur 45a71d67a7
nixos/sysupdate: add assertion for systemd built with sysupdate support 2025-07-11 14:07:01 -07:00
phaer dd88db29ed modules/systemd-oomd: add After=systemd-sysusers.service
Before this change, systemd-oomd startup was flaky at least with
either systemd-sysusers or userborn enabled. It would restart several
times until users were provisioned, so that it finally succeeded.

An alternative would be to use a DynamicUser which was my first
approach, before I discovered that upstream added the after statement
in Dec 2024[1]. DynamicUsers could have further
implications (sandboxing, etc), so we follow upstream here.

It's not clear to me we why Upstreams "After=systemd-sysusers.service"
doesn't show up on nixos-unstable systems (systemd v257.6).

Userborn is covered, as its unit is aliased to systemd-sysusers.service.

The following test succeeded after this change on x86_64-linux:

  nix-build -A nixosTests.systemd-oomd

[1]: 36dd429680
2025-07-11 15:13:25 +02:00
Florian Klink e47cbf3942 nixos/systemd/repart: add extraArgs option
There's lots of options regarding dm-crypt, dm-verity and TPMs.
Creating individual NixOS options for all of them would be infeasible.
2025-07-04 23:15:23 +03:00
Sandro Jäckel 5e4801914b
nixos/stage-1: fix option path in message 2025-07-03 17:54:49 +02:00
Shelvacu 8f0f76a32c nixos/grub: install memtest and other grub.extraFiles correctly when using mirroredBoots 2025-06-28 15:01:00 -07:00
Bogdan-Cristian Tătăroiu 3332613add nixos/systemd-initrd: Fix fsck.xfs failing due to missing sh
When running with a xfs root partition and using systemd for stage 1
initrd, I noticed in journalctl that fsck.xfs always failed to execute.

The issue is that it is trying to use the below sh interpreter:

`#!/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/sh -f`

but the file does not exist in the initrd image.

/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/**bash**
exists since it gets pulled in by some package, but the rest of the
directory is not being pulled in.

boot/systemd/initrd.nix mentions that xfs_progs references the sh
interpreter and seems to explicitly try to address this by adding
${pkgs.bash}/bin to storePaths, but that's the wrong bash package.

Update the `storePaths` value to pull in `pkgs.bashNonInteractive`
rather than `pkgs.bash`.
2025-06-28 14:50:51 +01:00
Florian Klink 32f7b63557
nixos/systemd-oomd: use the correct name for the top-level user slice (#418480) 2025-06-25 00:06:50 +03:00
Jason Yundt d54262911c nixos/systemd: fix run0 failing to run commands
Fixes #361592.

I was able to test this change by doing the following:

1. Create a file named “test-systemd-run0.nix” that contains this Nix
expression:

    let
      nixpkgs = /path/to/nixpkgs;
      pkgs = import nixpkgs { };
    in
    pkgs.testers.runNixOSTest {
      name = "test-systemd-run0";
      nodes.machine = {
        security.polkit.enable = true;
      };
      testScript = ''
        start_all()
        machine.succeed("run0 env")
      '';
    }

2. Replace “/path/to/nixpkgs” with the actual path to an actual copy of
Nixpkgs.

3. Run the integration test by running this command:

    nix-build <path to test-systemd-run0.nix>
2025-06-24 10:18:56 -04:00
Masum Reza a2b5af4710
limine-install: cleanup, improve type hinting (#416188) 2025-06-23 23:08:45 +05:30
r-vdp c28b3143da
nixos/systemd-oomd: use the correct name for the top-level user slice
`user-.slice` does not seem to exist, and the config we generate for it is
rejected by systemd (see `systemctl status user-.slice`).
I suppose that what was really intended here, was to configure
`user.slice`, which is the one that is documented in `man systemd.special`.

Reported-by: Ian Sollars <Ian.Sollars@brussels.msf.org>
2025-06-20 18:53:16 +02:00
K900 458a0d727d Merge remote-tracking branch 'origin/master' into staging-next 2025-06-16 12:41:22 +03:00
nikstur 50d0a81800 nixos/nix-store-veritysetup: init 2025-06-16 10:28:53 +02: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] 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
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
Ramses c0f89cb69e
nixos/limine: substituteAll -> replaceVarsWith (#406872) 2025-05-17 20:08:31 +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
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
nat e51e0da386
nixos/limine: substituteAll -> replaceVarsWith 2025-05-13 23:14:43 +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
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
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
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 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
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
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
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
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
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
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
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
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] 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 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
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