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 |
| 3 | { pkgs, lib, ... }: |
| 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; |
| 12 | }; |
| 13 | in |
| 14 | { |
| 15 | imports = [ |
| 16 | (builtins.fetchurl { |
| 17 | url = "https://gist.githubusercontent.com/graham33/fdbdcc18317a621d9dd54beb36be6683/raw/776ed252749313470f1c9a286a0419ba9746d133/loginctl-linger.nix"; |
| 18 | sha256 = "sha256:0hwm4f13dwd27gbdn5ddvbrmcvfb70jr658jz4nbkzwzh8c02qj8"; |
| 19 | }) |
| 20 | ]; |
| 21 | |
| 22 | users.users = lib.pipe ../services [ |
| 23 | builtins.readDir |
| 24 | (lib.filterAttrs (_name: value: value == "directory")) |
| 25 | builtins.attrNames |
| 26 | (map (name: { inherit name; value = mkUser name; })) |
| 27 | builtins.listToAttrs |
| 28 | ]; |
| 29 | } |