From 253a0165f072ce797c28da2dae9bd9610fd07069 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Thu, 16 Oct 2025 21:18:28 +0000 Subject: [PATCH] nixos/systemd-initrd: only include glibc nss modules on glibc systems --- nixos/modules/system/boot/systemd/initrd.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 =