# Home manager is used separately from this deploy, but we still need to create
# user accounts in the system config
{ base, pkgs, lib, config, ... }:
let
  mkUser = username:
    {
      isSystemUser = true;
      linger = true;
      createHome = true;
      home = "/services/${username}";
      group = "clicks";
      shell = pkgs.bashInteractive;
    } // (if builtins.pathExists "${../../services}/${username}/system.nix" then
      import "${../../services}/${username}/system.nix"
    else
      { });
in {
  users.users = lib.pipe ../../services [
    builtins.readDir
    (lib.filterAttrs (_name: value: value == "directory"))
    builtins.attrNames
    (map (name: {
      inherit name;
      value = mkUser name;
    }))
    builtins.listToAttrs
  ];
} // (if (base != null) then
  {
    /* users.groups = lib.mapAttrs'
       (_: user: {
         name = user.group;
         value = { };
       })
       base.config.users.users;
    */
  }
else
  { })
