Commit Graph

2675 Commits

Author SHA1 Message Date
nikstur
3fd41447c7 nixos/systemd/repart: add extraArgs option and Encrypt=tpm2 test (#422511) 2025-07-18 16:52:18 +02:00
Franz Pletz
71064c4808 nixos/systemd: fix run0 failing to run commands (#419588) 2025-07-17 22:18:10 +02:00
sanana
6baed48380 limine-install: fix profile enumeration
Fixes #425158.
2025-07-15 13:49:05 +05:30
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
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