Any interest in separating out `nixpkgs`' `lib` into its own repo & flake?

Often when creating flakes for new Nix tools or building blocks, I find myself wanting various basic functions for working with lists, strings, and so on.

As a result, I add the entirety of nixpkgs as a flake input just so I can access the handy lib attrs, despite not needing any other pkgs or nixos modules. nixpkgs feels like quite a lot of source to pull down just for a few primitive functions.

Has there been much discussion around having lib in its own repo, and then using that repo within nixpkgs? I can imagine it’s easier for nixpkgs maintainers to iterate on lib while it’s in the same repo, but it seems this may inevitably incentivize flake users to recreate a lot of the same functionality elsewhere?

Alternatively, perhaps there’s some way the nixpkgs CI can “publish” lib in some way that it’s accessible standalone :thinking:

In the case that there’s not enough enthusiasm for separating lib from nixpkgs, perhaps there’s interest from flake users in having a kind of lib (or core/std/base) under nixos or nix-community orgs for this purpose?

I came across divnix/std, but it looks like it’s more focused on devops than basic operations on nix primitives. chessai/nix-std looks closer to what I imagine, though looks fairly heavily haskell inspired (e.g. monoid, monad, applicative, etc) which I think is laudable but perhaps less useful in Nix where there’s no type-system to enforce the invariants of those abstractions.

If there was interest for this, I guess it would be easiest to start with a straight copy of nixpkgs/lib, as it’s at least a base most already agree upon (perhaps minus the nixpkgs-specific stuff (e.g. maintainers)?

Anyway, curious to get folks’ thoughts on this.


Awesome, clearly I didn’t dig deep enough!

1 Like

I’m currently perhaps the main lib maintainer, and I’d be totally onboard with splitting it into its own repo!