I don't know why, but for some reason nix already parses the relative file as a path while still concatenating it with strings. I made sure that nix instead concatednates the strings with right-to-left precedence, so that the "/" is included see also https://logs.nix.samueldr.com/nixos/2020-10-21#4134149;
27 lines
797 B
Nix
27 lines
797 B
Nix
{ 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;
|
|
}
|