diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index f2b1b4fc7ede..ba5f67058bd9 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -568,9 +568,6 @@ in "${cfg.package.util-linux}/bin/umount" "${cfg.package.util-linux}/bin/sulogin" - # so NSS can look up usernames - "${pkgs.glibc}/lib/libnss_files.so.2" - # Resolving sysroot symlinks without code exec "${config.system.nixos-init.package}/bin/chroot-realpath" # Find the etc paths @@ -586,7 +583,8 @@ in "${pkgs.bashNonInteractive}/bin" ] ++ jobScripts - ++ map (c: builtins.removeAttrs c [ "text" ]) (builtins.attrValues cfg.contents); + ++ map (c: builtins.removeAttrs c [ "text" ]) (builtins.attrValues cfg.contents) + ++ lib.optional (pkgs.hostPlatform.libc == "glibc") "${pkgs.glibc}/lib/libnss_files.so.2"; targets.initrd.aliases = [ "default.target" ]; units =