Added sanoid module.

This commit is contained in:
Joseph Hanson 2024-07-13 08:56:23 -05:00
parent 4394509d32
commit 700475f219
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
2 changed files with 26 additions and 0 deletions

View file

@ -11,5 +11,6 @@
./radicale ./radicale
./reboot-required-check.nix ./reboot-required-check.nix
./restic ./restic
./sanoid
]; ];
} }

View file

@ -0,0 +1,25 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.mySystem.services.sanoid;
in
{
options.mySystem.services.sanoid = {
enable = mkEnableOption "sanoid";
package = mkPackageOption pkgs "sanoid" { };
datasets = mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.unspecified);
};
templates = mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.unspecified);
};
};
config = mkIf cfg.enable {
# Enable sanoid with the given templates and datasets
services.sanoid = {
enable = true;
inherit (cfg) package datasets templates;
};
};
}