{ config, pkgs, ... }:

let
  home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz";
  settings = import ../settings.nix;
  nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
    inherit pkgs;
  };
  homeModules = [
    ./home/session.nix
    ./home/packages.nix
    ./home/git.nix
    ./home/gnome.nix
    ./home/librewolf.nix
    ./home/zed.nix
    ./home/ghostty.nix
  ];
in
{
  imports = [
    (import "${home-manager}/nixos")
  ];

  home-manager.useGlobalPkgs = true;
  home-manager.useUserPackages = true;

  home-manager.backupFileExtension = "backup";

  home-manager.extraSpecialArgs = {
    inherit settings nur;
  };

  home-manager.users.${settings.username} = { ... }: {
    imports = homeModules;
    home.stateVersion = "25.11";
  };
}
