simple-homemanager icon indicating copy to clipboard operation
simple-homemanager copied to clipboard

04 - The function call and inherit

Open feynmanliang opened this issue 1 year ago • 3 comments

The function call and inherit

How are you supposed to know this? You read it somewhere and copy/paste like the rest of us. Welcome to Nix! I actually still can't find that info in the official docs. If you know where it is, open an issue here.

I think args.system in https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/impure.nix#L17 is why?

feynmanliang avatar May 24 '24 14:05 feynmanliang

Nice find, but still need to find it in the docs! :D

Evertras avatar Jun 12 '24 10:06 Evertras

Is it this: https://nix.dev/manual/nix/2.18/language/constructs#inheriting-attributes ?

jameshulse avatar Aug 31 '24 02:08 jameshulse

A helpful link for inherit but unfortunately doesn't solve the puzzle of how to know that this:

makePkgs = import nixpkgs;
pkgs = makePkgs { inherit system; };

...is even a thing. Basically I'm not sure where it says in an official doc somewhere that doing import nixpkgs will give you a function back and that you should pass it an attribute set with system in it.

Evertras avatar Sep 01 '24 00:09 Evertras