This commit is contained in:
Harald Hoyer 2024-01-11 10:26:46 +00:00
parent 66c05f9093
commit 45d6f4b0f3
205 changed files with 9040 additions and 342 deletions

View file

@ -0,0 +1,47 @@
{ config, lib, ... }:
let
cfg = config.plusultra.system.zfs;
inherit (lib) mkEnableOption mkIf mkDefault;
inherit (lib.plusultra) mkOpt enabled;
inherit (lib.types) listOf str;
in
{
options.plusultra.system.zfs = {
enable = mkEnableOption "ZFS support";
pools = mkOpt (listOf str) [ "rpool" ] "The ZFS pools to manage.";
auto-snapshot = {
enable = mkEnableOption "ZFS auto snapshotting";
};
};
config = mkIf cfg.enable {
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
services.zfs = {
autoScrub = {
enable = true;
pools = cfg.pools;
};
autoSnapshot = mkIf cfg.auto-snapshot.enable {
enable = true;
flags = "-k -p --utc";
weekly = mkDefault 3;
daily = mkDefault 3;
hourly = mkDefault 0;
frequent = mkDefault 0;
monthly = mkDefault 2;
};
};
plusultra = {
tools = {
icehouse = enabled;
};
};
};
}