From 99eb836f19c4e15ecdb83e257dd7fb59ab83bf28 Mon Sep 17 00:00:00 2001 From: Soispha Peetz Date: Sat, 14 Nov 2026 17:56:00 +0100 Subject: modules/impermanence: Improve usability --- modules/by-name/im/impermanence/module.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'modules') 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" -- cgit v1.3.1