Added sanoid module.
This commit is contained in:
parent
4394509d32
commit
700475f219
2 changed files with 26 additions and 0 deletions
|
@ -11,5 +11,6 @@
|
||||||
./radicale
|
./radicale
|
||||||
./reboot-required-check.nix
|
./reboot-required-check.nix
|
||||||
./restic
|
./restic
|
||||||
|
./sanoid
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
25
nixos/modules/nixos/services/sanoid/default.nix
Normal file
25
nixos/modules/nixos/services/sanoid/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue