feat: made impermanence create datasets for zfs and persistence
This commit is contained in:
parent
409fdb7276
commit
adc6b90c93
4 changed files with 188 additions and 43 deletions
|
|
@ -1,4 +1,10 @@
|
|||
{lib, ...}: {...}: let
|
||||
args @ {
|
||||
lib,
|
||||
name,
|
||||
...
|
||||
}: {...}: let
|
||||
datasetSubmodule = (import ./dataset.nix) args;
|
||||
|
||||
pathPermissions = {
|
||||
read = lib.mkEnableOption "should the path have read permissions";
|
||||
write = lib.mkEnableOption "should the path have read permissions";
|
||||
|
|
@ -11,14 +17,14 @@
|
|||
default = true;
|
||||
};
|
||||
owner = {
|
||||
user = lib.mkOption {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nouser";
|
||||
};
|
||||
permissions = pathPermissions;
|
||||
};
|
||||
group = {
|
||||
group = lib.mkOption {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nogroup";
|
||||
};
|
||||
|
|
@ -31,16 +37,21 @@
|
|||
};
|
||||
in {
|
||||
imports = [
|
||||
./dataset.nix
|
||||
datasetSubmodule
|
||||
];
|
||||
|
||||
options = {
|
||||
files = lib.types.mkOption {
|
||||
files = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule pathTypeSubmodule);
|
||||
default = {};
|
||||
};
|
||||
directories = {
|
||||
directories = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule pathTypeSubmodule);
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
mountpoint = "/${name}";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue