wip: create dbzfs module

This commit is contained in:
xenia 2024-04-10 23:48:00 -04:00
parent 573f1954b0
commit e98d1584df
2 changed files with 37 additions and 0 deletions

View File

@ -2,6 +2,7 @@
{
imports = [
./modules/dragn-ball-zfs
./modules/ghidra-server
];

View File

@ -0,0 +1,36 @@
{ 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
'';
};
}