-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
default.nix
46 lines (41 loc) · 1.1 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
nurpkgs ? import <nixpkgs> { }, # For nixpkgs dependencies used by NUR itself
# Dependencies to call NUR repos with
# The override handles the case where NUR is installed via standalone channel or channel + override
pkgs ? (
import <nixpkgs> {
overrides = [
(final: prev: if prev ? nur then prev else { nur = ./. { pkgs = final; }; })
];
}
),
repoOverrides ? { },
}:
let
manifest = (builtins.fromJSON (builtins.readFile ./repos.json)).repos;
lockedRevisions = (builtins.fromJSON (builtins.readFile ./repos.json.lock)).repos;
inherit (nurpkgs) lib;
repoSource =
name: attr:
import ./lib/repoSource.nix {
inherit
name
attr
manifest
lockedRevisions
lib
;
inherit (nurpkgs) fetchgit fetchzip;
};
createRepo =
name: attr:
import ./lib/evalRepo.nix {
inherit name pkgs lib;
inherit (attr) url;
src = repoSource name attr + ("/" + (attr.file or ""));
};
in
{
repos = (lib.mapAttrs createRepo manifest) // repoOverrides;
repo-sources = lib.mapAttrs repoSource manifest;
}