diff --git a/modules/system/zfs/default.nix b/modules/system/zfs/default.nix new file mode 100644 index 0000000..7e85fe4 --- /dev/null +++ b/modules/system/zfs/default.nix @@ -0,0 +1,22 @@ +{ + options, + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.aa.system.zfs; +in { + options.aa.system.zfs = with types; { + enable = mkEnableOption "zfs"; + # TODO: Introduce a zfsOnRoot option + }; + + config = mkIf cfg.enable { + services.zfs = { + autoScrub.enable = true; + autoSnapshot.enable = true; + }; + }; +} diff --git a/systems/x86_64-linux/carbon/default.nix b/systems/x86_64-linux/carbon/default.nix index c9be65d..a2825f1 100644 --- a/systems/x86_64-linux/carbon/default.nix +++ b/systems/x86_64-linux/carbon/default.nix @@ -32,6 +32,8 @@ }; hardware.audio.enable = true; + + system.zfs.enable = true; }; networking = { diff --git a/systems/x86_64-linux/carbon/zfs.nix b/systems/x86_64-linux/carbon/zfs.nix index 591d638..429825c 100644 --- a/systems/x86_64-linux/carbon/zfs.nix +++ b/systems/x86_64-linux/carbon/zfs.nix @@ -54,9 +54,4 @@ ]; }; users.users.root.initialHashedPassword = "$6$VOzIHqv12iJGQIFl$NQf1GeiGhtdLfZFmtZl4vab.xvtVvI7.5ty9zbMFI2dpmHoFdc6XnGwTlClVe./CbcrsQjtPpt7NKf0dNttcw."; - - services.zfs = { - autoScrub.enable = true; - autoSnapshot.enable = true; - }; } diff --git a/systems/x86_64-linux/gospel/default.nix b/systems/x86_64-linux/gospel/default.nix index 4ecaed1..f56232b 100644 --- a/systems/x86_64-linux/gospel/default.nix +++ b/systems/x86_64-linux/gospel/default.nix @@ -39,6 +39,8 @@ }; hardware.audio.enable = true; + + system.zfs.enable = true; }; boot.binfmt.emulatedSystems = ["aarch64-linux" "armv6l-linux"];