Using `home-manager.useGlobalPkgs` while using `nixpkgs.overlays` or `nixpkgs.config`

Hi, I just updated my flake and then rebuilt my system. During the evaluation I got:

evaluation warning: osi profile: You have set either `nixpkgs.config` or `nixpkgs.overlays` while using `home-manager.useGlobalPkgs`.
                    This will soon not be possible. Please remove all `nixpkgs` options when using `home-manager.useGlobalPkgs`.

As far as I understand, soon the global packages configured in NixOS modules must not be modified anymore to keep using these global packages for Home Manager. Though, thats exactly what I want. I want to add some custom packages from input flakes to the pkgs set and I want this set to be the same everywhere. Even in the Home Manager modules.

Do I understand that correctly? If so how to achieve the desired behaviour with the constraint home manager gives me here (soon)

You must only configure nixpkgs options in your NixOS config if you want useGlobalPkgs.

1 Like

Thanks @waffle8946. That solved it for me. What got me was that I had both nixpkgs options in the system config and the hm config which threw me off where to look.