{
  pkgs,
  config,
  ...
}:
let
  passwordFile = config.sops.secrets."jallen-nas/admin_password".path;
in
{
  # Define a user account. Don't forget to set a password with ‘passwd’.
  users = {
    groups.nut.name = "nut";
    groups."jallen-nas".name = "jallen-nas";
    # Nix app account
    users = {
      nix-apps = {
        isSystemUser = true;
        uid = 911;
        group = "jallen-nas";
        extraGroups = [
          "jallen-nas"
          "docker"
          "podman"
          "keys"
        ];
        hashedPasswordFile = passwordFile;
      };
      nextcloud = {
        isNormalUser = true;
        extraGroups = [
          "jallen-nas"
          "nix-apps"
        ];
        hashedPasswordFile = passwordFile;
      };
      upsuser = {
        group = "nut";
        isNormalUser = false;
        isSystemUser = true;
        createHome = true;
        home = "/var/lib/nut";
        homeMode = "750";
        hashedPasswordFile = passwordFile;
      };
      root.shell = pkgs.zsh;
    };
  };
}
