···592592 systemd.services.systemd-importd.environment = proxy_env;
593593 systemd.services.systemd-pstore.wantedBy = [ "sysinit.target" ]; # see #81138
594594595595+ # NixOS has kernel modules in a different location, so override that here.
596596+ systemd.services.kmod-static-nodes.unitConfig.ConditionFileNotEmpty = [
597597+ "" # required to unset the previous value!
598598+ "/run/booted-system/kernel-modules/lib/modules/%v/modules.devname"
599599+ ];
600600+595601 # Don't bother with certain units in containers.
596602 systemd.services.systemd-remount-fs.unitConfig.ConditionVirtualization = "!container";
597603 systemd.services.systemd-random-seed.unitConfig.ConditionVirtualization = "!container";
+3
nixos/modules/system/boot/systemd/initrd.nix
···420420 services."systemd-makefs@" = lib.mkIf needMakefs { unitConfig.IgnoreOnIsolate = true; };
421421 services."systemd-growfs@" = lib.mkIf needGrowfs { unitConfig.IgnoreOnIsolate = true; };
422422423423+ # make sure all the /dev nodes are set up
424424+ services.systemd-tmpfiles-setup-dev.wantedBy = ["sysinit.target"];
425425+423426 services.initrd-nixos-activation = {
424427 after = [ "initrd-fs.target" ];
425428 requiredBy = [ "initrd.target" ];
···11-From c8b50208dce4c467c1f85c3db3e05bdcfd43c378 Mon Sep 17 00:00:00 2001
11+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22From: Eelco Dolstra <eelco.dolstra@logicblox.com>
33Date: Tue, 8 Jan 2013 15:46:30 +0100
44-Subject: [PATCH 01/18] Start device units for uninitialised encrypted devices
44+Subject: [PATCH] Start device units for uninitialised encrypted devices
5566This is necessary because the NixOS service that initialises the
77filesystem depends on the appearance of the device unit. Also, this
···2727 # add symlink to GPT root disk
2828 SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}!="crypto_LUKS", SYMLINK+="gpt-auto-root"
2929 SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}=="crypto_LUKS", SYMLINK+="gpt-auto-root-luks"
3030---
3131-2.36.1
3232-
···11-From 67daf22c74a780e283a493a0f9fdbbea2ce0aaba Mon Sep 17 00:00:00 2001
11+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22From: Eelco Dolstra <eelco.dolstra@logicblox.com>
33Date: Mon, 11 May 2015 15:39:38 +0200
44-Subject: [PATCH 06/18] Get rid of a useless message in user sessions
44+Subject: [PATCH] Get rid of a useless message in user sessions
5566Namely lots of variants of
77···26262727 /* If stopping a unit fails continuously we might enter a stop loop here, hence stop acting on the
2828 * service being unnecessary after a while. */
2929---
3030-2.36.1
3131-
···11-From 35dd77fafe73cc4a648f101163945cbcae8ed6b9 Mon Sep 17 00:00:00 2001
11+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22From: Imuli <i@imu.li>
33Date: Wed, 19 Oct 2016 08:46:47 -0400
44-Subject: [PATCH 10/18] localectl: use /etc/X11/xkb for list-x11-*
44+Subject: [PATCH] localectl: use /etc/X11/xkb for list-x11-*
5566NixOS has an option to link the xkb data files to /etc/X11, but not to
77/usr/share/X11.
···2222 if (!f)
2323 return log_error_errno(errno, "Failed to open keyboard mapping list. %m");
24242525---
2626-2.36.1
2727-
···11-From 201b588b4b30fb53aefaed43e5d434373a076cb0 Mon Sep 17 00:00:00 2001
11+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22From: Andreas Rammhold <andreas@rammhold.de>
33Date: Thu, 9 May 2019 11:15:22 +0200
44-Subject: [PATCH 12/18] add rootprefix to lookup dir paths
44+Subject: [PATCH] add rootprefix to lookup dir paths
5566systemd does not longer use the UDEVLIBEXEC directory as root for
77discovery default udev rules. By adding `$out/lib` to the lookup paths
···33333434 #define CONF_PATHS(n) \
3535 CONF_PATHS_USR(n) \
3636---
3737-2.36.1
3838-
···11-From 67434c58caddf7dd3cef66dd3e3f704d39e4bcb0 Mon Sep 17 00:00:00 2001
11+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22From: Nikolay Amiantov <ab@fmap.me>
33Date: Thu, 25 Jul 2019 20:45:55 +0300
44-Subject: [PATCH 13/18] systemd-shutdown: execute scripts in
44+Subject: [PATCH] systemd-shutdown: execute scripts in
55 /etc/systemd/system-shutdown
6677This is needed for NixOS to use such scripts as systemd directory is immutable.
···22222323 /* The log target defaults to console, but the original systemd process will pass its log target in through a
2424 * command line argument, which will override this default. Also, ensure we'll never log to the journal or
2525---
2626-2.36.1
2727-
···11-From 291ead07daab980fa39fd18512c8266c23161540 Mon Sep 17 00:00:00 2001
11+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22From: Yuriy Taraday <yorik.sar@gmail.com>
33Date: Fri, 17 Jun 2022 12:45:10 +0000
44-Subject: [PATCH 18/18] inherit systemd environment when calling generators.
44+Subject: [PATCH] inherit systemd environment when calling generators.
5566Systemd generators need access to the environment configured in
77stage-2-init.sh since it schedules fsck and mkfs executions based on
···37373838 r = strv_env_assign(&nl, "SYSTEMD_SCOPE", MANAGER_IS_SYSTEM(m) ? "system" : "user");
3939 if (r < 0)
4040---
4141-2.36.1
4242-
+5-5
pkgs/os-specific/linux/systemd/default.nix
···149149150150 # On major changes, or when otherwise required, you *must* reformat the patches,
151151 # `git am path/to/00*.patch` them into a systemd worktree, rebase to the more recent
152152- # systemd version, and export the patches again via `git -c format.signoff=false format-patch v${version}`.
152152+ # systemd version, and export the patches again via
153153+ # `git -c format.signoff=false format-patch v${version} --no-numbered --zero-commit --no-signature`.
153154 # Use `find . -name "*.patch" | sort` to get an up-to-date listing of all patches
154155 patches = [
155156 ./0001-Start-device-units-for-uninitialised-encrypted-devic.patch
···166167 ./0012-add-rootprefix-to-lookup-dir-paths.patch
167168 ./0013-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
168169 ./0014-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
169169- ./0015-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch
170170- ./0016-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
171171- ./0017-pkg-config-derive-prefix-from-prefix.patch
172172- ./0018-inherit-systemd-environment-when-calling-generators.patch
170170+ ./0015-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
171171+ ./0016-pkg-config-derive-prefix-from-prefix.patch
172172+ ./0017-inherit-systemd-environment-when-calling-generators.patch
173173 ] ++ lib.optional stdenv.hostPlatform.isMusl (
174174 let
175175 oe-core = fetchzip {