homeManagerConfigurations called without required argument 'pkgs'

I’ve added a homeConfigurations for a work machine so that I can have my configurations that I have on my other machines.

desktop builds fine (and I assume the other nixosConfigurations) do as well.

but when I try to build my work homeConfiguration I get this error

image

This is my flake

Not sure what I am doing wrong as I am believe I am inheriting the right pkgs …

As a best practice on coding forums, please share text rather than screenshots.

Also, based on the title of your post, you just need to pass pkgs as an argument to home-manager.lib.homeManagerConfiguration.

      homeConfigurations.FOOBAR = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages.x86_64-linux;
        # ...
      };

and you cannot use useGlobalPkgs or useUserPackages, naturally.

This only applies for standalone HM, of course, not HM as a NixOS module.

1 Like

Thanks I will use text.

Even adding it as you have here I get

[0] $> home-manager switch --flake github:cookEbox/nix-config#work

error:

   … from call site

     at /nix/store/jwgh7nvqlfbnwqnsr0jmcaswyw02a1ag-source/flake.nix:62:16:

       61|       homeConfigurations = {

       62|         work = home-manager.lib.homeManagerConfiguration {

         |                ^

       63|           inherit pkgs;



   error: function 'homeManagerConfiguration' called with unexpected argument 'home-manager'

   at /nix/store/cd0q2vk9vqwjg9rcilymm4x8f4n673zi-source/flake.nix:41:36:

       40|         hm = (import ./modules/lib/stdlib-extended.nix nixpkgs.lib).hm;

       41|         homeManagerConfiguration = { modules ? [ ], pkgs, lib ? pkgs.lib

         |                                    ^

       42|           , extraSpecialArgs ? { }, check ? true

Yes, the home-manager options only apply to the NixOS module. For standalone, remove them.

1 Like

homeConfigurations = {
work = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
./hosts/work/home
];
};

Still gets the same error