add repoOverrides option

This commit is contained in:
Jörg Thalheim 2019-01-22 12:13:17 +00:00
parent b37a7ee053
commit 9e87e21189
2 changed files with 24 additions and 2 deletions

View file

@ -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

View file

@ -1,6 +1,8 @@
{ nurpkgs ? import <nixpkgs> {} # 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;
}