1

Is there any project/repo that contains "standard library" functions extracted from the Nixpkgs repo?

Currently reading the Nixpkgs manual, and it seems that the Nixpkgs repo consists of

  • functions that actually help build (cross-platform) packages (written using the Nix builtin's/primitives)
  • collection of packages

Tried to find decentralization examples, but there aren't many (or I didn't find them). I like Cachix and the philosophy behind it, but that is for already built packages (unless I misunderstand something, which is more than possible).

Some of the resources found:


EDIT: Just found out about Nix User Repository (NUR).

EDIT2: Here's the thread on NixOS discourse.

toraritte
  • 6,300
  • 3
  • 46
  • 67
  • I don't see what the problem is with doing `(import ).usefulFunction` or the equivalent in your own repo. – David Grayson Apr 24 '19 at 03:24
  • @DavidGrayson To quote parkerhoyes: "[_Just experimenting, really._](https://www.reddit.com/r/NixOS/comments/e417gy/using_nix_without_nixpkgs/f9643lp?utm_source=share&utm_medium=web2x&context=3)" :) – toraritte May 01 '21 at 15:54

1 Answers1

2

Nixpkgs is a "megarepo", bundling highly related Nix projects, such as Nixpkgs, its standard library, NixOS and such. I am not aware of any other source or 'mirror' of these projects. If you want this to change, you can help out with the Nix Flakes idea/project/projects.

Today, if you only really need pkgs.lib, you can use lib = import <nixpkgs/lib>.

Robert Hensing
  • 6,708
  • 18
  • 23