Introducing NUR - the Nix User Repostory || Share all your nix expressions!


#1

To make sharing of nix packages easier and more decentralized I created NUR - the Nix User Repository.
It is a meta-repository, where contributor can add there own repositories to share nix expressions.

Checkout the examples in the documentation on how to use it:

In a nutshell it expose user contributed packages through namespace nur.repos.reponame
in e.x.:

$ nix-shell -p nur.repos.mic92.inxi

#2

Wow amazing. I was conceptualising exactly this yesterday when @zimbatm mentioned this project. Perfect!


#3

Just to understand, what’s the advantage of this over users hosting their own repos? The main thing I can think of would be that it is easier to grep through a single repo.


#4

It’s an index of repositories that follow some conventions. This is entirely about making it easier to find stuff. In the works is the plumbing and then the interface to have a search interface through all indexed repositories.

It also has some minor advantages, where a repository’s commit won’t advance if it doesn’t evaluate.

In practice, every repositories found in the NUR would always work without using them through the NUR.


#5

Hi,

So if I understand that correctly, I can also share functions I wrote
via this? For example, I have some functions which can be used to
modify packages in certain ways - I can share them here, too?

On another side: How can I bake this into my NixOS installation? So
that I can use NUR in my configuration.nix, essentially?

(Note that I’m on a sabatical and may respond slowly)


#6

You can add it like this:

{
  nixpkgs.config.packageOverrides = pkgs: {
    nur = pkgs.callPackage (import (builtins.fetchGit {
      url = "https://github.com/nix-community/NUR";
    })) {};
  };
}

And yeah, in your repo you can put anything you’d like to share with the world, doesn’t matter if it’s functions or derivations. :slight_smile:


#7

We would like to add namespaces in each repository for modules, functions and overlays so they are discoverable by search engines. I hope I can re-add documentation for this soon.


#8

NUR seems to be pretty much what AUR is for Arch Linux, just with a couple added bonuses, in that it can also contain functions or similar things.

While I like the idea of having these repositories easily discoverable, I do not like the idea of directly using them on my system due to the security implications. So any kind of search engine or even an automatically created list would be very appreciated.


#9

Yes, a search is definitely on the TODO list. To make review easier we tried to expose the owner directly, as it is often easier to trust a person then a package. Pinning could also be more convenient then copying the expression over. AUR also suffered lately from orphaned packages that were taken over by a malicious account - that is hopefully be more transparent in NUR.


#10

So circling back to this now that I’m actually using NixOS a bit more, and not just nixpkgs:

I think it would be a great special case of this to be the “docker hub” of nix containers, though I’d welcome others’ thoughts on this before diving in.