use builtin fetchers to prevent importing from derivation
This commit is contained in:
parent
8526cad551
commit
f71b30bf0e
2 changed files with 28 additions and 4 deletions
20
default.nix
20
default.nix
|
|
@ -5,7 +5,7 @@
|
||||||
pkgs ? (
|
pkgs ? (
|
||||||
import <nixpkgs> {
|
import <nixpkgs> {
|
||||||
overrides = [
|
overrides = [
|
||||||
(final: prev: if prev ? nur then prev else { nur = ./. { pkgs = final; }; })
|
(final: prev: if prev ? nur then prev else { nur = import ./. { pkgs = final; }; })
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
|
@ -19,6 +19,22 @@ let
|
||||||
inherit (nurpkgs) lib;
|
inherit (nurpkgs) lib;
|
||||||
|
|
||||||
repoSource =
|
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:
|
name: attr:
|
||||||
import ./lib/repoSource.nix {
|
import ./lib/repoSource.nix {
|
||||||
inherit
|
inherit
|
||||||
|
|
@ -42,5 +58,5 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
repos = (lib.mapAttrs createRepo manifest) // repoOverrides;
|
repos = (lib.mapAttrs createRepo manifest) // repoOverrides;
|
||||||
repo-sources = lib.mapAttrs repoSource manifest;
|
repo-sources = lib.mapAttrs repoSource' manifest;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,14 @@ else if (lib.hasPrefix "https://gitlab.com" attr.url || type == "gitlab") && !su
|
||||||
else
|
else
|
||||||
fetchgit {
|
fetchgit {
|
||||||
inherit (attr) url;
|
inherit (attr) url;
|
||||||
inherit (revision) rev sha256;
|
inherit (revision) rev;
|
||||||
fetchSubmodules = submodules;
|
|
||||||
}
|
}
|
||||||
|
// (
|
||||||
|
if fetchgit == builtins.fetchGit or null then
|
||||||
|
{ inherit submodules; }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inherit (revision) sha256;
|
||||||
|
fetchSubmodules = submodules;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue