{ pkgs, inputs, config, ... }:
let
  ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
  uid = 1000;
in
{
  users.groups.nipsy.gid = uid;
  users.users.nipsy = {
    description = "Mark Nipper";
    extraGroups = [
      "audio"
      "video"
      "wheel"
    ] ++ ifTheyExist [
      "adbusers"
      "dialout"
      "gamemode"
      "networkmanager"
      "vboxsf"
      "vboxusers"
    ];
    group = "nipsy";
    home = "/home/nipsy";
    isNormalUser = true;
    openssh.authorizedKeys.keys = [
      (builtins.readFile ./keys/id_arrakis.pub)
      #(builtins.readFile ./keys/id_other.pub)
    ];

    packages = [ pkgs.home-manager ];
    shell = pkgs.zsh;
    uid = uid;
  };
}
