diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-10-21 17:25:23 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-10-21 17:25:23 +0000 |
commit | 2a87a287685e127797106ffe684015a2371729fd (patch) | |
tree | 86f3180cc4eea397d9741a530593682404e94627 /nixpkgs/nixos/modules/tasks/filesystems/btrfs.nix | |
parent | 53533fd13b70e6e78e9a63c7dad027b116335a2d (diff) | |
parent | 83b8726e5f6f85a28405c7772f75093fd9a399a3 (diff) | |
download | nixlib-2a87a287685e127797106ffe684015a2371729fd.tar nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.gz nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.bz2 nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.lz nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.xz nixlib-2a87a287685e127797106ffe684015a2371729fd.tar.zst nixlib-2a87a287685e127797106ffe684015a2371729fd.zip |
Merge commit '83b8726e5f6f85a28405c7772f75093fd9a399a3'
Diffstat (limited to 'nixpkgs/nixos/modules/tasks/filesystems/btrfs.nix')
-rw-r--r-- | nixpkgs/nixos/modules/tasks/filesystems/btrfs.nix | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/nixpkgs/nixos/modules/tasks/filesystems/btrfs.nix b/nixpkgs/nixos/modules/tasks/filesystems/btrfs.nix index 82fdd6058710..87fe326c0974 100644 --- a/nixpkgs/nixos/modules/tasks/filesystems/btrfs.nix +++ b/nixpkgs/nixos/modules/tasks/filesystems/btrfs.nix @@ -52,34 +52,37 @@ in config = mkMerge [ (mkIf enableBtrfs { system.fsPackages = [ pkgs.btrfs-progs ]; + }) - boot.initrd.kernelModules = mkIf inInitrd [ "btrfs" ]; - boot.initrd.availableKernelModules = mkIf inInitrd ( + (mkIf inInitrd { + boot.initrd.kernelModules = [ "btrfs" ]; + boot.initrd.availableKernelModules = [ "crc32c" ] ++ optionals (config.boot.kernelPackages.kernel.kernelAtLeast "5.5") [ # Needed for mounting filesystems with new checksums "xxhash_generic" "blake2b_generic" "sha256_generic" # Should be baked into our kernel, just to be sure - ] - ); + ]; - boot.initrd.extraUtilsCommands = mkIf (inInitrd && !config.boot.initrd.systemd.enable) + boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) '' copy_bin_and_libs ${pkgs.btrfs-progs}/bin/btrfs ln -sv btrfs $out/bin/btrfsck ln -sv btrfsck $out/bin/fsck.btrfs ''; - boot.initrd.extraUtilsCommandsTest = mkIf (inInitrd && !config.boot.initrd.systemd.enable) + boot.initrd.extraUtilsCommandsTest = mkIf (!config.boot.initrd.systemd.enable) '' $out/bin/btrfs --version ''; - boot.initrd.postDeviceCommands = mkIf (inInitrd && !config.boot.initrd.systemd.enable) + boot.initrd.postDeviceCommands = mkIf (!config.boot.initrd.systemd.enable) '' btrfs device scan ''; + + boot.initrd.systemd.initrdBin = [ pkgs.btrfs-progs ]; }) (mkIf enableAutoScrub { |