README.md: add NUR usage

This commit is contained in:
Timothy DeHerrera 2020-01-10 00:38:59 -07:00
parent 506e810b9f
commit db5bc5f57c
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122

View file

@ -1,7 +1,9 @@
# Introduction
A NixOS configuration template using the experimental [flakes][rfc] mechanism.
Its aim is to provide a generic repository which neatly separates concerns
and allows one to get up and running with NixOS faster than ever.
and allows one to get up and running with NixOS faster than ever. In addition,
conveniences like [home-manager][home-manager] and [NUR][nur] are wired in by
default to help make life easier.
Flakes are still an experimental feature, but once they finally get merged
even more will become possible, i.e. [nixops](https://nixos.org/nixops)
@ -35,7 +37,6 @@ nixos-generate-config --show-hardware-config > ./hosts/${new_host}.nix
# any ./profiles you may wish to try out.
$EDITOR ./hosts/${new_host}.nix
# backup existing config and ensure configuration lives in expected location
mv /etc/nixos /etc/nixos.old
ln -s $PWD /etc/nixos
@ -95,6 +96,26 @@ this flake exports multiple outputs for use in other flakes:
```
### NUR usage
You can use packages, modules and overlays from the
[Nix User Repository][nur].
For modules and overlays, you can pull them in via the new top-level arguements
`nurModules` and `nurOverlays`, respectively:
```nix
{ nurModules, nurOverlays, pkgs, ... }:
{
# ...
imports = [ nurModules."${nur-username}.modules.${aModule}" ];
nixpkgs.overlays = [ nurOverlays."${nur-username}".overlays."${anOverlay}" ];
}
```
Packages are installable the same way as without flakes via
`pkgs.nur."${nur-username}"."${aPackage}"`.
# Structure
The structure is here to keep things simple and clean. Anything sufficiently
@ -206,6 +227,7 @@ licenses of the respective packages.
[direnv]: https://direnv.net
[home-manager]: https://github.com/rycee/home-manager
[NixOS]: https://nixos.org
[nur]: https://github.com/nix-community/NUR
[old]: https://github.com/nrdxp/nixos
[pr]: https://github.com/NixOS/nixpkgs/pull/68897
[rfc]: https://github.com/tweag/rfcs/blob/flakes/rfcs/0049-flakes.md