flake: home-manager: set overlays in module
All checks were successful
ci/woodpecker/push/check Pipeline was successful

I need to inherit `lib` to make sure it picks up my version, not the one
from `pkgs`.

I can't use `extraSpecialArgs` like NixOS, due to it missing from
upstream [1].

[1]: https://github.com/nix-community/home-manager/pull/3969
This commit is contained in:
Bruno BELANYI 2025-04-07 15:50:22 +00:00
parent 0152907536
commit a1cab7f606

View file

@ -3,6 +3,11 @@ let
defaultModules = [ defaultModules = [
# Include generic settings # Include generic settings
"${self}/modules/home" "${self}/modules/home"
{
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
inputs.nur.overlays.default
];
}
{ {
# Basic user information defaults # Basic user information defaults
home.username = lib.mkDefault "ambroisie"; home.username = lib.mkDefault "ambroisie";
@ -21,18 +26,15 @@ let
# * not letting me set `lib` as an extraSpecialArgs # * not letting me set `lib` as an extraSpecialArgs
# * not respecting `nixpkgs.overlays` [1] # * not respecting `nixpkgs.overlays` [1]
# [1]: https://github.com/nix-community/home-manager/issues/2954 # [1]: https://github.com/nix-community/home-manager/issues/2954
pkgs = import inputs.nixpkgs { pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit system;
overlays = (lib.attrValues self.overlays) ++ [
inputs.nur.overlays.default
];
};
modules = defaultModules ++ [ modules = defaultModules ++ [
"${self}/hosts/homes/${name}" "${self}/hosts/homes/${name}"
]; ];
# Use my extended lib in NixOS configuration
inherit (self) lib;
extraSpecialArgs = { extraSpecialArgs = {
# Inject inputs to use them in global registry # Inject inputs to use them in global registry
inherit inputs; inherit inputs;