diff --git a/nix/sources.json b/nix/sources.json
index 7e20d69825d59de215d77ed7ff92cbc8fe9a076e..528d4059ea046b4c3f344b41653369ef89565912 100644
--- a/nix/sources.json
+++ b/nix/sources.json
@@ -125,10 +125,10 @@ "description": "GPS log file viewer and analyzer with support for GPX, TCX, KML, FIT, IGC, NMEA, SLF, LOC, GeoJSON and OziExplorer files.",
"homepage": "https://www.gpxsee.org",
"owner": "tumic0",
"repo": "GPXSee",
"rev": "42b4216d9c43ff22146bfa305da766a3d330b2f9",
"sha256": "14pzcyy8kbnmr21yzml1hp7qmc055gyf48s27ff0jndd6f2dmxiq",
"rev": "2ff219511667d11b319877d0469954e2859a61ad",
"sha256": "0nwz0nafcm8bb9pc9cwx2fjl7kz9kr37hzkqm1hiynf14nld83in",
"type": "tarball",
"url": "https://github.com/tumic0/GPXSee/archive/42b4216d9c43ff22146bfa305da766a3d330b2f9.tar.gz",
"url": "https://github.com/tumic0/GPXSee/archive/2ff219511667d11b319877d0469954e2859a61ad.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"gpxsee-maps": {
@@ -209,10 +209,10 @@ "description": "OpenOrienteering Mapper is a software for creating maps for the orienteering sport.",
"homepage": "https://www.openorienteering.org/apps/mapper/",
"owner": "OpenOrienteering",
"repo": "mapper",
"rev": "b4466b076612314fb4ec2fa724489ea169a3d765",
"sha256": "1kp8pf7lcs1nya1bj28jpg6lb6xwh4m31cqp8m8fzkvgvk1ppf1s",
"rev": "43c0cb2b056a0f5a634e417fd0c2ccf8fb043386",
"sha256": "04jamq4an8abi3gfkd948kpgh6nln8zwahadsziwj8nw4giam06s",
"type": "tarball",
"url": "https://github.com/OpenOrienteering/mapper/archive/b4466b076612314fb4ec2fa724489ea169a3d765.tar.gz",
"url": "https://github.com/OpenOrienteering/mapper/archive/43c0cb2b056a0f5a634e417fd0c2ccf8fb043386.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"mapsoft": {
diff --git a/nix/sources.nix b/nix/sources.nix
index 2de89a6a4ea350ffb8e5e33cf7cfbac9c719fbb3..8a725cb4e7f02a9618e915f2b23245df6e5e1e13 100644
--- a/nix/sources.nix
+++ b/nix/sources.nix
@@ -1,25 +1,91 @@
-# A record, from name to path, of the third-party packages
-with rec
-{
if hasThisAsNixpkgsPath
then import (builtins_fetchTarball { inherit (sources_nixpkgs) url sha256; }) {}
else import <nixpkgs> {}
+let
builtins_fetchurl { inherit (spec) url sha256; }
else
import (builtins_fetchTarball { inherit (sources_nixpkgs) url sha256; }) {};
pkgs.fetchurl { inherit (spec) url sha256; };
builtins_fetchTarball { inherit (spec) url sha256; }
pkgs.fetchzip { inherit (spec) url sha256; };
''
WARNING:
The niv type "builtin-tarball" will soon be deprecated. You should
instead use `builtin = true`.
$ niv modify <package> -a type=tarball -a builtin=true
''
builtins_fetchTarball { inherit (spec) url sha256; };
''
WARNING:
The niv type "builtin-url" will soon be deprecated. You should
instead use `builtin = true`.
$ niv modify <package> -a type=file -a builtin=true
''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';
(builtins_fetchurl { inherit (spec) url sha256; });
sourcesNixpkgs =
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
if builtins.hasAttr "nixpkgs" sources
then sourcesNixpkgs
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
import <nixpkgs> {}
else
abort
''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
builtins_fetchTarball = { url, sha256 }@attrs:
@@ -41,56 +107,28 @@ fetchurl { inherit url; }
else
fetchurl attrs;
name: spec:
if builtins.hasAttr "outPath" spec
then abort
"The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = fetch config.pkgs name spec; }
# The sources, i.e. the attribute set of spec name to spec
inherit sources;
auto = builtins.intersectAttrs (functionArgs f) autoArgs;
f (auto // args);
fetcherName =
if builtins.hasAttr "type" spec
then builtins.getAttr "type" spec
else "builtin-tarball";
builtins.getAttr fetcherName {
"tarball" = fetchzip;
"builtin-tarball" = builtins_fetchTarball;
"file" = fetchurl;
"builtin-url" = builtins_fetchurl;
};
-};
-# NOTE: spec must not have an "outPath" attribute
-mapAttrs (
"The values in sources.json should not have an 'outPath' attribute"
if builtins.hasAttr "url" spec && builtins.hasAttr "sha256" spec
then
spec // { outPath = callFunctionWith spec (getFetcher spec) {}; }
else spec
-) sources
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
inherit pkgs;
+in
+mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
application/octet-stream
This content has been proxied by September (3851b).