blob: 0e1dbd66d0e5cdd6ce0b96c6416d671f1b9b7d05 [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
5 mkUser = username: {
6 isSystemUser = true;
7 linger = true;
8 createHome = true;
9 home = "/services/${username}";
10 group = "clicks";
11 shell = pkgs.bashInteractive;
Skyler Greya78aa672023-05-20 13:48:18 +020012 } // (
13 if builtins.pathExists "${../services}/${username}/system.nix"
14 then import "${../services}/${username}/system.nix"
15 else { }
16 );
Skyler Grey245a88f2023-05-01 21:35:57 +000017in
18{
Skyler Grey245a88f2023-05-01 21:35:57 +000019 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 Greya78aa672023-05-20 13:48:18 +020026} // (
27 if (base != null)
28 then {
TheCodedProfbdc23452023-06-14 13:39:10 -040029 /* users.groups = lib.mapAttrs'
Skyler Greya78aa672023-05-20 13:48:18 +020030 (_: user: {
31 name = user.group;
32 value = { };
33 })
34 base.config.users.users;*/
35 } else { }
36)