From db5bc5f57cf8f059003fed960315c138c065c414 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Fri, 10 Jan 2020 00:38:59 -0700 Subject: [PATCH] README.md: add NUR usage --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7ff5fd..3ef53a7 100644 --- a/README.md +++ b/README.md @@ -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