diff --git a/README.md b/README.md index f55b8ce..03f025e 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Remove old generations from EFI: sudo /run/current-system/bin/switch-to-configuration boot ``` -## Install Home Manager with niv +## Add Home Manager with niv niv: @@ -134,6 +134,18 @@ Use the corresponding branch: niv add nix-community/home-manager -n home-manager -b release-23.05 ``` +## Add NUR with niv + +> The Nix User Repository (NUR) is community-driven meta repository for Nix packages. +> +> ... packages are built from source and are not reviewed by any Nixpkgs member. +> +> https://github.com/nix-community/NUR + +```shell +niv add nix-community/NUR -n NUR +``` + ## disko and nixos-anywhere * Introductory presentation: https://pad.lassul.us/cccamp-workshop diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index 28eaedc..3e6dfee 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -19,6 +19,8 @@ in (import "${home-manager}/nixos") ../../modules/home-manager.nix + ../../modules/nur.nix + ../../modules/base.nix ../../modules/programs.nix ../../modules/autostart.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 53286cb..640dde1 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -19,6 +19,8 @@ in (import "${home-manager}/nixos") ../../modules/home-manager.nix + ../../modules/nur.nix + ../../modules/base.nix ../../modules/programs.nix ../../modules/autostart.nix diff --git a/modules/nur.nix b/modules/nur.nix new file mode 100644 index 0000000..35ac12c --- /dev/null +++ b/modules/nur.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + # Import NUR. + #nixpkgs.config.packageOverrides = pkgs: { + # nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { + # inherit pkgs; + # }; + #}; + + # Import NUR with niv. + nixpkgs.config.packageOverrides = pkgs: { + nur = import (import ../nix/sources.nix).NUR { + inherit pkgs; + }; + }; + + # Test if NUR was imported successfully. + #environment.systemPackages = with pkgs; [ + # nur.repos.mic92.hello-nur + #]; +} diff --git a/nix/sources.json b/nix/sources.json index e7b7d44..df52b1d 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,4 +1,16 @@ { + "NUR": { + "branch": "master", + "description": "Nix User Repository: User contributed nix packages [maintainer=@Mic92]", + "homepage": "https://nur.nix-community.org/", + "owner": "nix-community", + "repo": "NUR", + "rev": "85d19938ef33d82db0207c39f11f5947d5a5215e", + "sha256": "0vxjj8czwcg2vz42r5jknaxg1z6jhq1djf6zs5rq70mhsb041v3x", + "type": "tarball", + "url": "https://github.com/nix-community/NUR/archive/85d19938ef33d82db0207c39f11f5947d5a5215e.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "home-manager": { "branch": "release-23.05", "description": "Manage a user environment using Nix [maintainer=@rycee] ",