1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8with lib;
9
10let
11
12 inInitrd = config.boot.initrd.supportedFilesystems.apfs or false;
13
14in
15
16{
17 config = mkIf (config.boot.supportedFilesystems.apfs or false) {
18
19 system.fsPackages = [ pkgs.apfsprogs ];
20
21 boot.extraModulePackages = [ config.boot.kernelPackages.apfs ];
22
23 boot.initrd.kernelModules = mkIf inInitrd [ "apfs" ];
24
25 # Don't copy apfsck into the initramfs since it does not support repairing the filesystem
26 };
27}