about summary refs log tree commit diff
path: root/nixos/modules/tasks/filesystems
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2021-02-10 00:37:24 +0100
committerLuflosi <luflosi@luflosi.de>2022-01-27 15:18:45 +0100
commit26a695399a0e8bc40c502655c3d147f1791e774f (patch)
tree66ccbde6a0d419408e00cfc432efec3b15cadcb4 /nixos/modules/tasks/filesystems
parenta4e916ad037be7c36c4b2381b8b522233e5ab939 (diff)
downloadnixlib-26a695399a0e8bc40c502655c3d147f1791e774f.tar
nixlib-26a695399a0e8bc40c502655c3d147f1791e774f.tar.gz
nixlib-26a695399a0e8bc40c502655c3d147f1791e774f.tar.bz2
nixlib-26a695399a0e8bc40c502655c3d147f1791e774f.tar.lz
nixlib-26a695399a0e8bc40c502655c3d147f1791e774f.tar.xz
nixlib-26a695399a0e8bc40c502655c3d147f1791e774f.tar.zst
nixlib-26a695399a0e8bc40c502655c3d147f1791e774f.zip
nixos/apfs: init
Add the final missing pieces for full APFS support.
Diffstat (limited to 'nixos/modules/tasks/filesystems')
-rw-r--r--nixos/modules/tasks/filesystems/apfs.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/modules/tasks/filesystems/apfs.nix b/nixos/modules/tasks/filesystems/apfs.nix
new file mode 100644
index 000000000000..2f2be351df61
--- /dev/null
+++ b/nixos/modules/tasks/filesystems/apfs.nix
@@ -0,0 +1,22 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  inInitrd = any (fs: fs == "apfs") config.boot.initrd.supportedFilesystems;
+
+in
+
+{
+  config = mkIf (any (fs: fs == "apfs") config.boot.supportedFilesystems) {
+
+    system.fsPackages = [ pkgs.apfsprogs ];
+
+    boot.extraModulePackages = [ config.boot.kernelPackages.apfs ];
+
+    boot.initrd.kernelModules = mkIf inInitrd [ "apfs" ];
+
+    # Don't copy apfsck into the initramfs since it does not support repairing the filesystem
+  };
+}