blob: 3ca8e1ba3d835e828d7b9ae17a0dde6ffa2791c5 [file] [log] [blame]
Skyler Grey245a88f2023-05-01 21:35:57 +00001# Home manager is used separately from this deploy, but we still need to create
2# user accounts in the system config
Skyler Greya78aa672023-05-20 13:48:18 +02003{ base, pkgs, lib, config, ... }:
Skyler Grey245a88f2023-05-01 21:35:57 +00004let
Skyler Greyfe1740c2023-10-21 01:24:18 +00005 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 { });
17in {
Skyler Grey245a88f2023-05-01 21:35:57 +000018 users.users = lib.pipe ../services [
19 builtins.readDir
20 (lib.filterAttrs (_name: value: value == "directory"))
21 builtins.attrNames
Skyler Greyfe1740c2023-10-21 01:24:18 +000022 (map (name: {
23 inherit name;
24 value = mkUser name;
25 }))
Skyler Grey245a88f2023-05-01 21:35:57 +000026 builtins.listToAttrs
27 ];
Skyler Greyfe1740c2023-10-21 01:24:18 +000028} // (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 }
38else
39 { })