From 1abf15417972cd54eb7013e4a87f6b2de30d8590 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Sun, 20 Mar 2022 16:00:43 -0400 Subject: [PATCH] systemd-initrd: Add PATH to everything --- nixos/modules/system/boot/systemd/initrd.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index cd626a915a41..ecdb6b58de77 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -307,6 +307,14 @@ in { { object = "${cfg.package.util-linux}/bin/umount"; } { object = "${cfg.package.util-linux}/bin/sulogin"; } + { + object = builtins.toFile "system.conf" '' + [Manager] + DefaultEnvironment=PATH=/bin:/sbin + ''; + symlink = "/etc/systemd/system.conf"; + } + # TODO: Not sure why this needs to be here for the recovery shell to work { object = "${pkgs.glibc}/lib/libnss_files.so"; } @@ -332,7 +340,6 @@ in { } { object = "${initrdBinEnv}/bin"; symlink = "/bin"; } { object = "${initrdBinEnv}/sbin"; symlink = "/sbin"; } - { object = builtins.toFile "bashrc" "PATH=/bin:/sbin"; symlink = "/etc/bashrc"; } { object = builtins.toFile "sysctl.conf" "kernel.modprobe = /sbin/modprobe"; symlink = "/etc/sysctl.d/nixos.conf"; } ];