numtide / flake-utils

Pure Nix flake utility functions [maintainer=@zimbatm]
MIT License
1.14k stars 78 forks source link

by-name #110

Closed mightyiam closed 8 months ago

mightyiam commented 8 months ago

Would this flake-utils be a good home for a by-name function for the community? A by-name function that provides callPackaging from */package.nix, similar to what was recently added to Nixpkgs.

mightyiam commented 8 months ago

by-name could be implemented using builtins only, so perhaps it should be its own flake.

zimbatm commented 8 months ago

Probably not since it's tightly coupled with nixpkgs. Might as well add it to nixpkgs.lib directly?

mightyiam commented 8 months ago

Does this look nice? https://github.com/mightyiam/by-name

zimbatm commented 8 months ago

Yep. It's at a place where I could use it if I wanted. If you want to go further, add a motivation section that explains why it exists. What is it good for, and in what context? How does it compare to other solutions?

mightyiam commented 7 months ago

Sorry. I was under a wrong impression that flake-utils has nixpkgs as input, which affected my decision regarding where to publish the by-name implementation.

I also seem to have not properly absorbed your input:

Probably not since it's tightly coupled with nixpkgs. Might as well add it to nixpkgs.lib directly?

I'm not completely certain where I would best prefer a byName implementation to live; in nixpkgs or in flake-utils or somewhere else.

Is it really coupled with nixpkgs? It's just a simple pattern implementation.

zimbatm commented 7 months ago

Do you want by-name to track the implementation of nixpkgs? If yes, then might as well re-export the version that is implemented in nixpkgs.

mightyiam commented 7 months ago

On the other hand, flake-utils is specifically about flakes, isn't it? So, perhaps byName is not a great fit in it.

Do you want by-name to track the implementation of nixpkgs?

Nah... it's only inspired by it. I just want it to be useful and convenient.