forked from nix-community/NUR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
62 lines (56 loc) · 1.51 KB
/
default.nix
File metadata and controls
62 lines (56 loc) · 1.51 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
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 = import ./. { 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
;
fetchgit = builtins.fetchGit or nurpkgs.fetchgit;
fetchzip = builtins.fetchTarball or nurpkgs.fetchzip;
};
# https://github.com/nix-community/NUR/issues/916
# Use Nixpkgs fetchers in repo-sources for compatibility with ci
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;
}