flake: set source path in home-manager tool

This makes sure that a NIX_PATH entry is added for use by non-flake
commands, for example `home-manager uninstall`.

Fixes #3948
This commit is contained in:
Robert Helgesson 2023-05-07 11:26:13 +02:00
parent 669669fcb4
commit a834ddf88c
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -78,7 +78,8 @@
in throwForRemovedArgs (import ./modules {
inherit pkgs lib check extraSpecialArgs;
configuration = { ... }: {
imports = modules;
imports = modules
++ [{ programs.home-manager.path = toString ./.; }];
nixpkgs = { inherit (pkgs) config overlays; };
};
});
@ -96,7 +97,7 @@
let
pkgs = nixpkgs.legacyPackages.${system};
docs = import ./docs { inherit pkgs; };
hmPkg = pkgs.callPackage ./home-manager { };
hmPkg = pkgs.callPackage ./home-manager { path = toString ./.; };
in {
default = hmPkg;
home-manager = hmPkg;