summaryrefslogtreecommitdiffstats
path: root/modules/hardcodedUsers.nix
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2025-09-08 11:06:49 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2025-09-08 11:06:49 +0200
commitb55e007a15bf251156a59d7c5eaa9fc54dcd6cd8 (patch)
treea0ce5ea70b630e5c9dfa501ef9d38539081609fa /modules/hardcodedUsers.nix
parenta485724fdc452fa19b337c2364a105243635acb3 (diff)
add `declarativeUsers` contractmain
- example consumer `users.declarativeUsers` (creates users as Linux users) - example provider `hardcodedUsers.<group>` (static configuration of user groups (each group is a `declarativeUsers` provider)
Diffstat (limited to 'modules/hardcodedUsers.nix')
-rw-r--r--modules/hardcodedUsers.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/hardcodedUsers.nix b/modules/hardcodedUsers.nix
new file mode 100644
index 0000000..344daf2
--- /dev/null
+++ b/modules/hardcodedUsers.nix
@@ -0,0 +1,20 @@
+{ config, lib, ... }: {
+ options.hardcodedUsers = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.submodule (mod: {
+ options = {
+ users = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.submodule {});
+ default = {};
+ };
+ declarativeUsers = lib.mkOption {
+ type = config.contracts.declarativeUsers.provider;
+ default = null;
+ };
+ };
+ }));
+ default = {};
+ };
+ config.hardcodedUsers.default.declarativeUsers.output = {
+ inherit (config.hardcodedUsers.default) users;
+ };
+}