<utdemir>
Hey. I am using home-manager as a NixOS module (`home-manager.users.username = args: {};`), and the configuration is built on a pinned nixpkgs. However I observe the resulting derivation using NIX_PATH somehow. Can anyone tell me why home manager is using `NIX_PATH` instead of `pkgs`? Or am I doing something wrong?
__monty__ has joined #home-manager
<utdemir>
In other words, these two traces return different paths: `home-manager.users.username = builtins.trace (pkgs.path) ({ pkgs, ... }: { home.packages = builtins.trace (pkgs.path) []; });`
<__monty__>
Wouldn't it be weird for them not to?
<utdemir>
Probably my mental model is wrong then. I'd expect home-manager to inherit `pkgs` from the configuration in that case.
<__monty__>
What I meant is if nested traces are identical you'd have a problem.
<utdemir>
Why would I have a problem?
<__monty__>
How would you tell which trace is which for one?
<utdemir>
I changed it to this: ` home-manager.users.username = builtins.trace ("outside: ${pkgs.path}") ({ pkgs, ... }: { home.packages = builtins.trace ("inside: ${pkgs.path}") []; });`
<utdemir>
outside is my pinned nixpkgs, inside comes from my NIX_PATH.
<__monty__>
Looks like it's never getting to the inner trace?
<utdemir>
Nah I just couldn't figure out how to put a newline in a message. The inside trace starts in the middle of the line.
<__monty__>
Oh, was confused because you sent it twice. IRC doesn't allow line breaks.
<utdemir>
My mistake, sorry.
<utdemir>
It looks like the one from NIX_PATH is read by the `modules/misc/nixpkgs` module. And there is no way to override it.
<__monty__>
I'm not clear on what you're trying to do. If you don't want the inner thing to get passed a nixpkgs, why not drop the argument and put references to the right nixpkgs inline? Or give a default value for pkgs.
<utdemir>
the thing is that, even if my home-manager configuration is empty (as above), home-manager still uses some stuff from NIX_PATH and incurs some dependencies to packages from that.
<utdemir>
I'm trying to build a system configuration while using a pinned nixpkgs, without referring to `<nixpkgs>`. However since home-manager depends on `<nixpkgs>` internally it pollutes my system image.
mexisme has quit [Ping timeout: 245 seconds]
<rycee>
utdemir: You can add `_module.args.pkgs = mkForce outerPkgs;` inside the HM configuration.
<rycee>
Need to add a let binding to the system configuration that binds `outerPkgs = pkgs;`
<rycee>
This will prevent you from configuring nixpkgs from inside the user configuration, though.
<utdemir>
Do you think this is a use case you might want to officially support somehow?
<rycee>
Yeah, this is pretty much official :-)
<rycee>
utdemir: An alternative would be to change the nixos module so that it introduces a `systemPkgs` argument or similar so that it's possible to use both pkgs and systemPkgs.
<utdemir>
Understood. If you're happy with the solution I'm happy. Thank you for your answer, and thank you so much for creating home-manager.
<rycee>
No worries, thanks :-)
utdemir has quit [Remote host closed the connection]
<Melkor333>
hmm.. Let me try this.. I may've been overthinking it
dbyte has joined #home-manager
dbyte has quit [Quit: Quit]
dbyte has joined #home-manager
<rycee>
Good luck :-)
dbyte has quit [Quit: Quit]
<Melkor333>
It seems to work but now I have a completely different problem.. I'm using home-manager in the nixos config as described in the nixos wiki, but I always get "error opening lock file '/nix/var/nix/profiles/default.lock': Permission denied"...
<Melkor333>
I haven't used home-manager before so it's probably some kind of initial setup problem
dbyte has joined #home-manager
Melkor333 has quit [Quit: WeeChat 2.6]
Melkor333 has joined #home-manager
hmpffff_ has quit [Quit: nchrrrr…]
hmpffff has joined #home-manager
hmpffff has quit [Client Quit]
hmpffff has joined #home-manager
hmpffff has quit [Client Quit]
<Melkor333>
rycee: fixed the permission issue temporarily. Thank you it seems to work! Now I just got to find out how to initiate git submodules :D