From 3332613adda6c22f06d17002db812ba47f239772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan-Cristian=20T=C4=83t=C4=83roiu?= Date: Sat, 28 Jun 2025 12:56:46 +0100 Subject: [PATCH] nixos/systemd-initrd: Fix fsck.xfs failing due to missing sh When running with a xfs root partition and using systemd for stage 1 initrd, I noticed in journalctl that fsck.xfs always failed to execute. The issue is that it is trying to use the below sh interpreter: `#!/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/sh -f` but the file does not exist in the initrd image. /nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/**bash** exists since it gets pulled in by some package, but the rest of the directory is not being pulled in. boot/systemd/initrd.nix mentions that xfs_progs references the sh interpreter and seems to explicitly try to address this by adding ${pkgs.bash}/bin to storePaths, but that's the wrong bash package. Update the `storePaths` value to pull in `pkgs.bashNonInteractive` rather than `pkgs.bash`. --- nixos/modules/system/boot/systemd/initrd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index c6a0dbccd8d3..eed6be0765ef 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -532,7 +532,7 @@ in # required for services generated with writeShellScript and friends pkgs.runtimeShell # some tools like xfs still want the sh symlink - "${pkgs.bash}/bin" + "${pkgs.bashNonInteractive}/bin" # so NSS can look up usernames "${pkgs.glibc}/lib/libnss_files.so.2"