1 { config, lib, pkgs, ... }:
7 inInitrd = config.boot.initrd.supportedFilesystems.xfs or false;
12 config = mkIf (config.boot.supportedFilesystems.xfs or false) {
14 system.fsPackages = [ pkgs.xfsprogs.bin ];
16 boot.initrd.availableKernelModules = mkIf inInitrd [ "xfs" "crc32c" ];
18 boot.initrd.extraUtilsCommands = mkIf (inInitrd && !config.boot.initrd.systemd.enable)
20 copy_bin_and_libs ${pkgs.xfsprogs.bin}/bin/fsck.xfs
21 copy_bin_and_libs ${pkgs.xfsprogs.bin}/bin/xfs_repair
24 # Trick just to set 'sh' after the extraUtils nuke-refs.
25 boot.initrd.extraUtilsCommandsTest = mkIf (inInitrd && !config.boot.initrd.systemd.enable)
27 sed -i -e 's,^#!.*,#!'$out/bin/sh, $out/bin/fsck.xfs
30 boot.initrd.systemd.initrdBin = mkIf inInitrd [ pkgs.xfsprogs.bin ];