refactor(nix): dedupe home-manager wiring across hosts ♻️

Extract the per-host home-manager block (useGlobalPkgs, useUserPackages,
backupFileExtension, users.<name> with username/homeDirectory/optional
stateVersion/optional imports) into nixos/lib/home-manager-user.nix.
Each flake-module now imports it with its per-host parameters, removing
~40 lines of boilerplate across the four hosts.
This commit is contained in:
DannyDannyDanny 2026-04-18 17:20:51 +02:00
parent 00ab64d83c
commit c69c7c9b11
5 changed files with 55 additions and 44 deletions

View file

@ -7,17 +7,12 @@
../hosts/wsl.nix
../fish.nix
# Home Manager on WSL
inputs.home-manager.nixosModules.home-manager
({ lib, ... }: {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.dth = { ... }: {
home.username = "dth";
home.homeDirectory = lib.mkForce "/home/dth";
imports = [ ../home/danny/home.nix ];
};
(import ../lib/home-manager-user.nix {
lib = inputs.nixpkgs.lib;
user = "dth";
homeDirectory = "/home/dth";
userImports = [ ../home/danny/home.nix ];
})
];
};