blob: a3f450e86331371dd266f4c3c27dac1b82208a1f [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{
19 imports = [
20 (builtins.fetchurl {
21 url = "https://gist.githubusercontent.com/graham33/fdbdcc18317a621d9dd54beb36be6683/raw/776ed252749313470f1c9a286a0419ba9746d133/loginctl-linger.nix";
22 sha256 = "sha256:0hwm4f13dwd27gbdn5ddvbrmcvfb70jr658jz4nbkzwzh8c02qj8";
23 })
24 ];
25
26 users.users = lib.pipe ../services [
27 builtins.readDir
28 (lib.filterAttrs (_name: value: value == "directory"))
29 builtins.attrNames
30 (map (name: { inherit name; value = mkUser name; }))
31 builtins.listToAttrs
32 ];
Skyler Greya78aa672023-05-20 13:48:18 +020033} // (
34 if (base != null)
35 then {
36/* users.groups = lib.mapAttrs'
37 (_: user: {
38 name = user.group;
39 value = { };
40 })
41 base.config.users.users;*/
42 } else { }
43)