den
 1{
 2  lib,
 3  den,
 4  ...
 5}: let
 6  inherit (den.lib) __findFile;
 7in {
 8  den.aspects.hpcesia.includes = [
 9    <den/primary-user>
10  ];
11
12  # for all hosts that hpcesia has access to
13  den.aspects.hpcesia.provides.to-hosts.includes = [
14    ({host, ...}: let
15      listHas = l: e: (lib.lists.findFirstIndex (x: x == e) null l) != null;
16      isDevelop = listHas ["dev-server" "desktop" "laptop"] host.usage;
17      isGraphic = listHas ["desktop" "laptop"] host.usage;
18    in {
19      includes =
20        (lib.optionals isDevelop [
21          <dev>
22        ])
23        ++ (lib.optionals isGraphic [
24          <game>
25        ])
26        ++ (lib.optionals (isDevelop && isGraphic) [
27          <desktop/yubikey>
28          <dev/desktop>
29        ]);
30    })
31  ];
32
33  # host specific configuration for kevin
34  den.aspects.hpcesia.provides.kevin.includes = [
35    <pardofelis/ssh>
36  ];
37
38  den.aspects.hpcesia.nixos = {config, ...}: {
39    users.users.hpcesia = {
40      description = "HPCesia";
41      hashedPasswordFile = config.vaultix.secrets.user-hpcesia-hashed-password.path;
42      extraGroups =
43        []
44        ++ (lib.optionals config.virtualisation.podman.enable ["podman"])
45        ++ (lib.optionals config.virtualisation.docker.enable ["docker"])
46        ++ (lib.optionals config.programs.gamemode.enable ["gamemode"]);
47      openssh.authorizedKeys.keys = [
48        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFMKaGC2I3an4AJDeWzVx5vhm63+kxi6zJNdh7yEp6CK hpcesia@kevin"
49      ];
50    };
51
52    vaultix.secrets.user-hpcesia-hashed-password.file = ./hashed-password.age;
53  };
54
55  den.aspects.hpcesia.homeManager = {
56    # This value determines the Home Manager release that your
57    # configuration is compatible with. This helps avoid breakage
58    # when a new Home Manager release introduces backwards
59    # incompatible changes.
60    #
61    # You can update Home Manager without changing this value. See
62    # the Home Manager release notes for a list of state version
63    # changes in each release.
64    home.stateVersion = "25.11";
65  };
66}