From 5bc2d42ba9c84e805bcd388d9973f9f69da54925 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Mon, 28 Jul 2025 11:07:13 +0200 Subject: [PATCH] nixos/systemd: make boot.initrd.systemd.managerEnvironment affect boot.initrd.systemd.settings.Manager --- nixos/modules/system/boot/systemd/initrd.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index 905232b66864..c2b1b1ab005c 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -475,6 +475,10 @@ in }; managerEnvironment.PATH = "/bin:/sbin"; + settings.Manager.ManagerEnvironment = lib.concatStringsSep " " ( + lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment + ); + settings.Manager.DefaultEnvironment = "PATH=/bin:/sbin"; contents = { "/tmp/.keep".text = "systemd requires the /tmp mount point in the initrd cpio archive"; @@ -483,13 +487,7 @@ in "/etc/systemd/system.conf".text = '' [Manager] - DefaultEnvironment=PATH=/bin:/sbin ${attrsToSection cfg.settings.Manager} - ManagerEnvironment=${ - lib.concatStringsSep " " ( - lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment - ) - } ''; "/lib".source = "${config.system.build.modulesClosure}/lib";