summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-11-14 17:56:00 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-14 18:35:52 +0100
commit99eb836f19c4e15ecdb83e257dd7fb59ab83bf28 (patch)
treea6f7daed150704df6c43d7927e6ef236818e0295 /modules
parentmodules/*: Remove all `mkDefaultEnabled` calls (diff)
downloadnixos-config-99eb836f19c4e15ecdb83e257dd7fb59ab83bf28.zip
modules/impermanence: Improve usability
Diffstat (limited to 'modules')
-rw-r--r--modules/by-name/im/impermanence/module.nix20
1 files changed, 16 insertions, 4 deletions
diff --git a/modules/by-name/im/impermanence/module.nix b/modules/by-name/im/impermanence/module.nix
index a0c308d5..8172d90a 100644
--- a/modules/by-name/im/impermanence/module.nix
+++ b/modules/by-name/im/impermanence/module.nix
@@ -24,13 +24,19 @@ in {
mode = lib.mkOption {
type = lib.types.str;
};
+ group = lib.mkOption {
+ type = lib.types.str;
+ };
+ user = lib.mkOption {
+ type = lib.types.str;
+ };
};
}));
description = "The directories to persist";
};
userDirectories = lib.mkOption {
- type = lib.types.attrsOf (lib.types.listOf (lib.types.either lib.types.str (lib.types.submodule {
+ type = lib.types.nullOr (lib.types.attrsOf (lib.types.listOf (lib.types.either lib.types.str (lib.types.submodule {
options = {
directory = lib.mkOption {
type = lib.types.str;
@@ -38,9 +44,15 @@ in {
mode = lib.mkOption {
type = lib.types.str;
};
+ group = lib.mkOption {
+ type = lib.types.str;
+ };
+ user = lib.mkOption {
+ type = lib.types.str;
+ };
};
- })));
- default = [];
+ }))));
+ default = null;
description = "The directories to persist, for each user.";
};
};
@@ -54,7 +66,7 @@ in {
hideMounts = true;
inherit (cfg) directories;
- users = userDirectories;
+ users = lib.mkIf (cfg.userDirectories != null) userDirectories;
files = [
"/etc/machine-id"