Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 1 | # Home manager is used separately from this deploy, but we still need to create |
| 2 | # user accounts in the system config |
Skyler Grey | a78aa67 | 2023-05-20 13:48:18 +0200 | [diff] [blame] | 3 | { base, pkgs, lib, config, ... }: |
Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 4 | let |
| 5 | mkUser = username: { |
| 6 | isSystemUser = true; |
| 7 | linger = true; |
| 8 | createHome = true; |
| 9 | home = "/services/${username}"; |
| 10 | group = "clicks"; |
| 11 | shell = pkgs.bashInteractive; |
Skyler Grey | a78aa67 | 2023-05-20 13:48:18 +0200 | [diff] [blame] | 12 | } // ( |
| 13 | if builtins.pathExists "${../services}/${username}/system.nix" |
| 14 | then import "${../services}/${username}/system.nix" |
| 15 | else { } |
| 16 | ); |
Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 17 | in |
| 18 | { |
Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 19 | users.users = lib.pipe ../services [ |
| 20 | builtins.readDir |
| 21 | (lib.filterAttrs (_name: value: value == "directory")) |
| 22 | builtins.attrNames |
| 23 | (map (name: { inherit name; value = mkUser name; })) |
| 24 | builtins.listToAttrs |
| 25 | ]; |
Skyler Grey | a78aa67 | 2023-05-20 13:48:18 +0200 | [diff] [blame] | 26 | } // ( |
| 27 | if (base != null) |
| 28 | then { |
TheCodedProf | bdc2345 | 2023-06-14 13:39:10 -0400 | [diff] [blame] | 29 | /* users.groups = lib.mapAttrs' |
Skyler Grey | a78aa67 | 2023-05-20 13:48:18 +0200 | [diff] [blame] | 30 | (_: user: { |
| 31 | name = user.group; |
| 32 | value = { }; |
| 33 | }) |
| 34 | base.config.users.users;*/ |
| 35 | } else { } |
| 36 | ) |