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 |
Skyler Grey | fe1740c | 2023-10-21 01:24:18 +0000 | [diff] [blame] | 5 | mkUser = username: |
| 6 | { |
| 7 | isSystemUser = true; |
| 8 | linger = true; |
| 9 | createHome = true; |
| 10 | home = "/services/${username}"; |
| 11 | group = "clicks"; |
| 12 | shell = pkgs.bashInteractive; |
| 13 | } // (if builtins.pathExists "${../services}/${username}/system.nix" then |
| 14 | import "${../services}/${username}/system.nix" |
| 15 | else |
| 16 | { }); |
| 17 | in { |
Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 18 | users.users = lib.pipe ../services [ |
| 19 | builtins.readDir |
| 20 | (lib.filterAttrs (_name: value: value == "directory")) |
| 21 | builtins.attrNames |
Skyler Grey | fe1740c | 2023-10-21 01:24:18 +0000 | [diff] [blame] | 22 | (map (name: { |
| 23 | inherit name; |
| 24 | value = mkUser name; |
| 25 | })) |
Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 26 | builtins.listToAttrs |
| 27 | ]; |
Skyler Grey | fe1740c | 2023-10-21 01:24:18 +0000 | [diff] [blame] | 28 | } // (if (base != null) then |
| 29 | { |
| 30 | /* users.groups = lib.mapAttrs' |
| 31 | (_: user: { |
| 32 | name = user.group; |
| 33 | value = { }; |
| 34 | }) |
| 35 | base.config.users.users; |
| 36 | */ |
| 37 | } |
| 38 | else |
| 39 | { }) |