Commit Graph

14 Commits

Author SHA1 Message Date
dramforever
4145ba7dfd nixos/ifstate: Fix systemd package references
pkgs.systemd does not respect config.systemd.package and
config.boot.initrd.systemd.package overrides. Fix references to the
systemd package to ensure that the udevadm used is copied into the
initrd.

While we're at it, fix the non-initrd reference to systemd as well.
2026-07-31 19:49:58 +08:00
rnhmjoj
1e4eb2df3f nixos: completely remove systemd-udev-settle.service
This service is essentially a random sleep() call that old software that
is unable to properly handle modern hardware initialisation being
asynchronous can use to *mostly* get by.

Over the years is has caused so many issues in NixOS, like introducing
long delays in the boot process[1], complete deadlocks[2] and even failures
when reloading services or activating a new configuration[3].

systemd has been discouraging its use since 2011 (15 years ago!), then
it officially deprecated it in 2018 and since 2020 it started to show on
every boot a huge wall of text calling out all the offending services
that still use it.

Around 2021 we managed to fix around 15 NixOS modules[4] that were
relying on systemd-udev-settle and practically ZFS[5] was the only
remaining one. However, since then, people have actually started to
bring it back with new services[6][7][8]. This is not acceptable.

So, to prevent any more (lazy) uses of systemd-udev-settle, we stop
providing the systemd-udev-settle.service unit entirely. For existing
modules that unfortunately still need it, we replace it with the command
`udevadm settle --timeout=180`, which is all that the service does.
Hopefully this will also increase the awareness that it's bad and
something to be fixed.

Note: I tested this change using

 - `nixosTests.zfs`,
 - `nixosTests.ifstate`,
 - `nixosTests.misc`,
 - `nixosTests.openvswitch`,
 - `nixosTests.predictable-interface-names`
 - `nixosTests.nvidia-container-toolkit`

and making sure that none of the 165 packages that provide upstream
units (via the `systemd.packages` option) had a dependency on
systemd-udev-settle.service.

[1]: https://github.com/NixOS/nixpkgs/pull/25311
[2]: https://github.com/NixOS/nixpkgs/issues/107341
[3]: https://github.com/NixOS/nixpkgs/pull/113804
[4]: https://github.com/NixOS/nixpkgs/issues/73095
[5]: https://github.com/openzfs/zfs/issues/10891
[6]: https://github.com/NixOS/nixpkgs/pull/257525#discussion_r1442702970
[7]: https://github.com/NixOS/nixpkgs/pull/460075
[8]: https://github.com/NixOS/nixpkgs/pull/284507
2026-04-08 21:11:35 +02:00
NAHO
a2ed7e8d88 nixos: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --exclude doc/manual/release-notes \
      --type file \
      . \
      nixos \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2026-01-15 16:07:55 +01:00
Marcel
c321cd5771 nixos/ifstate: configure kernel params also for initrd-only installations 2025-11-29 12:37:47 +01:00
Marcel
63a32d9b42 nixos/ifstate: update descriptions 2025-11-29 12:37:46 +01:00
Nico Felbinger
e62a56d41d ifstate: 2.1.0 -> 2.2.0 2025-11-23 23:28:28 +01:00
Marcel
3e3c37a7dc nixos/ifstate: wait for udev to settle
because ifstate is not a daemon it can not cope with devices becoming available late

d8e38d4aaa/units/systemd-udev-settle.service (L10-L12)
> This service can dynamically be pulled-in by legacy services which
> cannot reliably cope with dynamic device configurations, and wrongfully
> expect a populated /dev during bootup.
2025-11-09 16:18:19 +01:00
h7x4
428342cce1 nixos/ifstate: builtins.any -> builtins.elem 2025-10-26 16:23:35 +09:00
Marcel
3bbaab6184 ifstate: 2.0.0 -> 2.0.1 2025-09-15 18:59:20 +02:00
Marcel
25863e23a2 nixos/ifstate: deuplicate common initrd and non-initrd service config 2025-09-09 23:53:12 +02:00
Marcel
f3f9a71af6 nixos/ifstate: remove initrd default dependencies 2025-09-09 21:04:10 +02:00
Marcel
bc846d64d2 nixos/ifstate: add upstream initrd networking targets 2025-09-09 21:04:09 +02:00
Marcel
f73402c75f nixos/ifstate: remove manual /var/run creation
The directory seems to be created by other processes using recent
changes in master now. Therefore the manual mkdir is not needed anymore.

As per the removed code comment, this will probably also be fixed later
in pyroute2 directly.
2025-09-09 21:04:06 +02:00
Marcel
8d8c9633bf nixos/ifstate: init 2025-08-21 17:44:54 +02:00