forked from nix-community/NUR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
27 lines (22 loc) · 795 Bytes
/
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
{ nurpkgs ? import <nixpkgs> {} # For nixpkgs dependencies used by NUR itself
# Dependencies to call NUR repos with
, pkgs ? null
, 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;
}