NUR
NUR copied to clipboard
Move top-level packages to a `pkgs` attribute
Followup from https://github.com/nix-community/NUR/pull/27#issuecomment-406816320
I propose to move all the packages from the top-level to a pkgs
attribute, so that default.nix
only contains pkgs
, lib
, modules
, and overlays
.
Pros:
Cons:
- slightly more complicated basic structure
- five more characters for the user to type
- can be avoided by making the packages available at the top-level but using this repo's code, not individually on each nur-packages
can be avoided by making the packages available at the top-level but using this repo's code, not individually on each nur-packages
You mean like nur.{pkgs,modules,overlays,lib}.paul.foo
instead of nur.repos.paul.{pkgs,modules,overlays,lib}.foo
? That might be pretty neat.
I meant nur.repos.paul.foo
(but done at this repo's level) in addition to nur.repos.paul.{pkgs,modules,overlays,lib}.foo
, but nur.{pkgs,modules,overlays,lib}.paul.foo
sounds even better! It's even one character less than the original ;-)
As compatibility layer we could check for the existence of pkgs
in the repository and fallback to top-level otherwise.
I'm not convinced that compatibility layer would be worth the extra complexity (and documentation effort). Right now, it's cheap to break the interface, only a dozen repos would have to be updated (again).
Normally I would expect to be able to nix-build
the repo top-level. If additional arguments are introduced it's going to make harder to provide defaults for all of them.
@zimbatm What argument are you talking about? Implementing this should not add any arguments, just alter the structure of the returned attrset.
doh, nevermind. I was still thinking of { pkgs, lib, ...}
as the recommended default.nix
arguments.
Bump
How about we introduce multiple types of repositories? Instead of cramming everything into one.
-
singlePackage
for a single package. For example https://github.com/direnv/direnv -
packageSet
for a package set like https://github.com/garbas/nixpkgs-python -
distro
for a combination of nixos modules and packages -
overlay
?
The details can vary
FWIW I'm not so very fond of the nur.{pkgs,modules,overlays,lib}.paul.foo
naming scheme since it seems to limit me to one of a few approved "top-level" namespaces.
So if I wanted to add a set of Home Manager modules I wouldn't know what to choose. I guess nur.modules.rycee.home-manager.foo
might work but then it all gets mixed up with NixOS modules (and I also happen to have a NixOS module named home-manager
🙂).
I do think it is a good idea to endorse a pkgs
attribute under which all packages go, i.e., nur.repos.paul.pkgs.foo
.