From 9e87e211893345c890ba7a71d85dcd87b6d0cb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 22 Jan 2019 12:13:17 +0000 Subject: [PATCH] add repoOverrides option --- README.md | 20 ++++++++++++++++++++ default.nix | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ded9c5447..82043917b 100644 --- a/README.md +++ b/README.md @@ -350,6 +350,26 @@ with pkgs.lib; } ``` +## Overriding repositories + +You can override repositories using `repoOverrides` argument. +This allows to test changes before publishing. + +``` +{ + packageOverrides = pkgs: { + nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { + inherit pkgs; + repoOverrides = { + mic92 = import ../nur-packages; + ## remote locations are also possible: + # mic92 = import (builtins.fetchTarball "https://github.com/your-user/nur-packages/archive/master.tar.gz"); + }; + }; + }; +} +``` + ## Contribution guideline - When adding packages to your repository make sure they build and set diff --git a/default.nix b/default.nix index d2507eeaa..dc22f02ca 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,8 @@ { nurpkgs ? import {} # For nixpkgs dependencies used by NUR itself # Dependencies to call NUR repos with -, pkgs ? null }: +, pkgs ? null +, repoOverrides ? { } +}: let manifest = (builtins.fromJSON (builtins.readFile ./repos.json)).repos; @@ -20,6 +22,6 @@ let }; in { - repos = lib.mapAttrs createRepo manifest; + repos = (lib.mapAttrs createRepo manifest) // repoOverrides; repo-sources = lib.mapAttrs repoSource manifest; }