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