{ inputs, den, lib, config, ... }:
let
  identity = config.local.identity;
in {
  imports = [ inputs.den.flakeModule ];

  den.schema.user.classes = lib.mkDefault [ "homeManager" ];
  den.default.homeManager.home.stateVersion = "25.11";

  den.hosts.x86_64-linux.desktop = {
    users.zoty = {};
    home-manager.module = inputs.home-manager.nixosModules.home-manager;
  };

  den.hosts.x86_64-linux.notebook = {
    users.zoty = {};
    home-manager.module = inputs.home-manager.nixosModules.home-manager;
  };

  den.hosts.x86_64-linux.work = {
    users.zoty = {};
    home-manager.module = inputs.home-manager.nixosModules.home-manager;
  };

  den.aspects.notebook = {
    includes = [
      den.provides.hostname
      den.aspects.core
      den.aspects.services
      den.aspects.wayland
      den.aspects.niri
      den.aspects.portable
      den.aspects.notebook-specific
      den.aspects.dev
      den.aspects.creative
      den.aspects.secrets
    ];
    nixos = {
      system.stateVersion = "25.11";
    };
  };

  den.aspects.work = {
    includes = [
      den.provides.hostname
      den.aspects.core
      den.aspects.services
      den.aspects.wayland
      den.aspects.niri
      den.aspects.portable
      den.aspects.work-specific
      den.aspects.secrets
      den.aspects.dev
    ];
    nixos = {
      system.stateVersion = "25.11";
    };
  };

  den.aspects.desktop = {
    includes = [
      den.provides.hostname
      den.aspects.core
      den.aspects.services
      den.aspects.wayland
      den.aspects.niri
      den.aspects.desktop-specific
      den.aspects.dev
      den.aspects.creative
      den.aspects.secrets
      den.aspects.steam
      den.aspects.prismlauncher
      den.aspects.androidcam
      den.aspects.winvm
    ];
    nixos = {
      system.stateVersion = "25.11";
    };
  };

  den.aspects.zoty = {
    includes = [
      den.provides.define-user
      den.provides.primary-user
    ];
    nixos = { pkgs, ... }: {
      users.users.zoty = {
        isNormalUser = true;
        extraGroups  = [ "wheel" "video" "audio" "input" ];
        shell = pkgs.zsh;
        hashedPasswordFile = "/run/secrets/user-password";
      };
      programs.zsh.enable = true;
      home-manager = {
        useGlobalPkgs    = true;
        useUserPackages  = true;
        backupFileExtension  = "backup";
        extraSpecialArgs = { inherit inputs identity; };
      };
    };
    homeManager = {
      imports = [
        ./_home/default.nix
        ./_home/niri.nix
        ./_home/cursor.nix
        ./_home/git.nix
        ./_home/dolphin.nix
        ./_home/theme.nix
        ./_home/xdg-dirs.nix
      ];
    };
  };
}
