Cheaper nixpkgs.lib for flake users

  • Some projects choose to not depend on nixpkgs for a variety of reasons.

  • Such projects often re-implement library function just to work around that restriction.

Trying to alleviate the bending-over-backwards I’ve seen out in the wild, I set up a github workflow that extracts lib from NixOS/nixpkgs every Sunday.

Use it like so:

{
  inputs.lib.url = "https://github.com/divnix/nixpkgs.lib";
}

Any feedback welcome, we’ll see if it entirely works as intended by next sunday, I guess — if there are changes to ./lib available upstream. :wink:

6 Likes

You beat me to it! Good work.

I realized it’s actually somewhat dumb what I did.

We’d rather want to have that flake.nix within nixpkgs/lib folder.

Wouldn’t that be equivalent when used with inputs.lib = github:NixOS/nixpkgs?dir=lib;?

1 Like

And so I did: init: lib/flake by blaggacao · Pull Request #119967 · NixOS/nixpkgs · GitHub

If you’re committer, and don’t fundamentally disagree with this, please consider merging init: lib/flake by blaggacao · Pull Request #119967 · NixOS/nixpkgs · GitHub before it stalls. :heart: — Helps keeping me motivated. Thank you!