dragnpkgs/modules/dragn-ball-zfs/default.nix

37 lines
871 B
Nix
Raw Permalink Normal View History

2024-04-11 03:48:00 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.dbzfs;
in {
options.dbzfs = {
enable = mkEnableOption "dbzfs" // {
default = true;
};
package = mkPackageOption pkgs "zfs" {};
managedRoot = mkOption {
default = null;
example = literalExpression "\"rpool/data\"";
description = mdDoc "Root dataset which is managed by dbzfs.";
type = types.str;
};
datasets = mkOption {
default = [];
example = literalExpression "TODO";
description = mdDoc "List of datasets to set up with dbzfs";
type = types.listOf types.anything; # todo
};
};
config = mkIf cfg.enable {
assertions = [{
assertion = cfg.managedRoot != null;
message = "dbzfs is enabled but dbzfs.managedRoot is not defined!";
}];
system.activationScripts.dbzfs = ''
echo meow
'';
};
}