jakehamilton / config

One Nix flake to rule them all.
Other
360 stars 21 forks source link

[Question] package-namespace #7

Closed olifloof closed 1 year ago

olifloof commented 1 year ago

where did you get it from and how do I use it in my own config?

jakehamilton commented 1 year ago

Hey there 👋

package-namespace is currently called overlay-package-namespace on the stable release of Snowfall Lib. See the packages section for an example: https://github.com/snowfallorg/lib#internal-packages-and-outputs

When creating and consuming your own packages in your flake I found it was very easy to accidentally hit infinite recursion or collide with NixPkgs. Because of this, Snowfall Lib namespaces your packages. The default functionality is that Snowfall Lib put your packages in pkgs.internal for consumption within your flake and any consumers would get the packages available directly on pkgs. However, you can (and are encouraged to) use a custom namespace which will be available both within your flake and exposed to consumers.

In my case I've set package-namespace = "plusultra" so inside of my flake I can refer to pkgs.plusultra.<my-package> and anyone using my overlays will also get pkgs.plusultra.

olifloof commented 1 year ago

doesn't it also work for modules?

olifloof commented 1 year ago

oh so I would have to use dev for that version that does modules, is my assumption correct?

jakehamilton commented 1 year ago

Do you mean module options? Those are not modified at all. Whatever you declare for options are what is used.