diff options
| author | andromeda <andromeda@lenovo> | 2025-12-31 02:28:00 +0100 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2025-12-31 02:28:00 +0100 |
| commit | 4b8882d82dcc8667d2b1276d65e43d081c5fa868 (patch) | |
| tree | e83b7e4734e05c5f7d72ccb3c6228448f5fad420 /users.nix | |
| parent | 42a93f042e2c821939fa6aa4ac8945997d5b5099 (diff) | |
change pub key management again, centralize users, start to modularize lenovo conf
Diffstat (limited to 'users.nix')
| -rw-r--r-- | users.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/users.nix b/users.nix new file mode 100644 index 0000000..7902ca4 --- /dev/null +++ b/users.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + machine, + ... +}: let + machines = import ./machines.nix; +in { + users.users = + builtins.mapAttrs + (name: value: lib.mkIf (builtins.elem name machine.users) value) + { + "andromeda" = { + isNormalUser = true; + description = "andromeda"; + hashedPasswordFile = builtins.toString config.age.secrets.secret0.path; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + "mtgmonkey" = { + isNormalUser = true; + description = "mtgmonkey"; + hashedPasswordFile = builtins.toString config.age.secrets.secret1.path; + extraGroups = [ + (lib.mkIf + (machine == machines.lenovo) + "networkmanager") + "wheel" + ]; + openssh.authorizedKeys.keys = [ + (lib.mkIf + (machine == machines._173-249-5-230) + config.pub-keys.ssh.andromeda) + ]; + }; + }; +} |
