diff --git a/nix/sources.json b/nix/sources.json
index d1fc73a51c4d4a421fd192556891ddb057314a7f..aada9350445a9bfdc7713c03792c9bbeb2f877f5 100644
--- a/nix/sources.json
+++ b/nix/sources.json
@@ -44,15 +44,15 @@ },
"cheetah3": {
"branch": "master",
"builtin": false,
"date": "2020-12-14T17:50:07Z",
"date": "2021-01-01T22:01:06Z",
"description": "Cheetah3 is a free (MIT) and open source template engine for Python",
"homepage": "https://cheetahtemplate.org/",
"owner": "CheetahTemplate3",
"repo": "cheetah3",
"rev": "089e45aadb92d6cd24ccdc8e9a2accac1f7223ba",
"sha256": "1aq1qkfyx1kdra8a8xysv11frwzis2yfa5y9li90rqg48p80izxi",
"rev": "50804e70261bc9476c8a498985fd93b931b18ae6",
"sha256": "0fq6inzr04zbsqmbzj8khr1l8whab61xpzvdp3lchz0lkwms8ppn",
"type": "tarball",
"url": "https://github.com/CheetahTemplate3/cheetah3/archive/089e45aadb92d6cd24ccdc8e9a2accac1f7223ba.tar.gz",
"url": "https://github.com/CheetahTemplate3/cheetah3/archive/50804e70261bc9476c8a498985fd93b931b18ae6.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"csvquote": {
@@ -170,15 +170,15 @@ },
"embox": {
"branch": "master",
"builtin": false,
"date": "2020-12-29T17:58:24Z",
"date": "2020-12-31T08:57:22Z",
"description": "Modular and configurable OS for embedded applications",
"homepage": "http://embox.github.io",
"owner": "embox",
"repo": "embox",
"rev": "68eb38c57473eaa12a295bffe15115cea2cb363e",
"sha256": "0d1c4sv9jfwivxbp29b7szrp5jirb4hsp118ssxngbvkvbhdm60c",
"rev": "df47a5a853928315904670fd8e03c88e97602823",
"sha256": "0lvlmw60ab3n48cqb857phsvw9mpc5qfva4dw7wyilgs635x567c",
"type": "tarball",
"url": "https://github.com/embox/embox/archive/68eb38c57473eaa12a295bffe15115cea2cb363e.tar.gz",
"url": "https://github.com/embox/embox/archive/df47a5a853928315904670fd8e03c88e97602823.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"foma": {
@@ -239,27 +239,27 @@ "url_template": "https://github.com///archive/.tar.gz"
},
"geofabrik-estonia": {
"builtin": false,
"sha256": "16l4n89fzh6g8rcjn1n6g18xjvycbvsmvcvbfnhhz7sbsg3drfi3",
"sha256": "0xhb0yg6hf09zdyhw59gsky6fdx5x7jfch3i6gp66vqzmxc951wr",
"type": "file",
"url": "https://download.geofabrik.de/europe/estonia-201228.osm.pbf",
"url": "https://download.geofabrik.de/europe/estonia-201231.osm.pbf",
"url_template": "https://download.geofabrik.de/europe/estonia-<version>.osm.pbf",
"version": "201228"
"version": "201231"
},
"geofabrik-finland": {
"builtin": false,
"sha256": "10jzcc551f5p8gvmnp2vyb9kql4vxmcifkpzvpkvw1vdx3xhb782",
"sha256": "0s3wvndspnl0p918j8qgnihr4y61ylb2zs7cznmghrwd6kk0ic3d",
"type": "file",
"url": "https://download.geofabrik.de/europe/finland-201228.osm.pbf",
"url": "https://download.geofabrik.de/europe/finland-201231.osm.pbf",
"url_template": "https://download.geofabrik.de/europe/finland-<version>.osm.pbf",
"version": "201228"
"version": "201231"
},
"geofabrik-russia-nwfd": {
"builtin": false,
"sha256": "18rc0413v1p67wzphp0v92hr3dvdfkmclyjkgh7bsxhc3dajfh78",
"sha256": "06jicr6xix1dgmbvy39ijly3sqnq7xhbq81ja066cm0jlwf31na6",
"type": "file",
"url": "https://download.geofabrik.de/russia/northwestern-fed-district-201228.osm.pbf",
"url": "https://download.geofabrik.de/russia/northwestern-fed-district-201231.osm.pbf",
"url_template": "https://download.geofabrik.de/russia/northwestern-fed-district-<version>.osm.pbf",
"version": "201228"
"version": "201231"
},
"gimgtools": {
"branch": "master",
@@ -377,15 +377,15 @@ "gpxsee": {
"branch": "master",
"builtin": false,
"changelog": "https://build.opensuse.org/package/view_file/home:tumic:GPXSee/gpxsee/gpxsee.changes",
"date": "2020-12-30T08:26:26Z",
"date": "2021-01-01T11:52:00Z",
"description": "GPS log file viewer and analyzer",
"homepage": "https://www.gpxsee.org",
"owner": "tumic0",
"repo": "GPXSee",
"rev": "7e39a34d0ea189bfd1220b981632f14c0b63741f",
"sha256": "08lyc99c2ipigmmyg2ag5ka378xlakbggq2359910wz5pyyidv13",
"rev": "4cb369d2f3528c7ddff3f079393b0d2c18518bb0",
"sha256": "0qm46am1kxd664rvdx52cqmqf3a35dhb7lagfy77mhb71nnpvhj1",
"type": "tarball",
"url": "https://github.com/tumic0/GPXSee/archive/7e39a34d0ea189bfd1220b981632f14c0b63741f.tar.gz",
"url": "https://github.com/tumic0/GPXSee/archive/4cb369d2f3528c7ddff3f079393b0d2c18518bb0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"gpxsee-maps": {
@@ -629,15 +629,15 @@ },
"mapper": {
"branch": "master",
"builtin": false,
"date": "2020-12-30T05:53:02Z",
"date": "2021-01-01T15:37:39Z",
"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": "ca4f2946603862af3a9c5cc211a15ee4058a980b",
"sha256": "0hh9rmy27d1l9v78h6kss2gacc1x3mkv80fsdx6dc2zgjyxwi7nh",
"rev": "d6ed6b3f0bb60836b5a73eb41b5ec8dfd0707094",
"sha256": "1vx7ii87qrn9m3mx72xzs90l0xqzrhwgipdb7z4zdvvwlfgkjly9",
"type": "tarball",
"url": "https://github.com/OpenOrienteering/mapper/archive/ca4f2946603862af3a9c5cc211a15ee4058a980b.tar.gz",
"url": "https://github.com/OpenOrienteering/mapper/archive/d6ed6b3f0bb60836b5a73eb41b5ec8dfd0707094.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"maprec": {
@@ -673,11 +673,11 @@ "builtin": false,
"description": "Ежедневная сборка карт из данных OpenStreetMap для навигационных приборов и приложений Garmin",
"homepage": "https://maptourist.org",
"region": "szfo",
"sha256": "15rkvzpd5h6v9nh0b8n39f8qs6i4a6hiq3jz96as3x8rwkngg04q",
"sha256": "1glvaqkrfsrdj84nca1wkvdpw5n02fry7fr4ixijzwr2xxkscq0l",
"type": "file",
"url": "https://maptourist.org/osm-garmin/archive/OSM-MapTourist-szfo-RU_2020-12-29.zip",
"url": "https://maptourist.org/osm-garmin/archive/OSM-MapTourist-szfo-RU_2021-01-01.zip",
"url_template": "https://maptourist.org/osm-garmin/archive/OSM-MapTourist-<region>-RU_<version>.zip",
"version": "2020-12-29"
"version": "2021-01-01"
},
"mercantile": {
"branch": "master",
@@ -860,15 +860,15 @@ },
"py-staticmaps": {
"branch": "master",
"builtin": false,
"date": "2020-11-28T13:45:19Z",
"date": "2020-12-31T10:49:07Z",
"description": "A python module to create static map images with markers, geodesic lines, etc.",
"homepage": "https://github.com/flopp/py-staticmaps",
"owner": "flopp",
"repo": "py-staticmaps",
"rev": "cbe706fd266137cdf8a412f6ca54c02e4bc89fa6",
"sha256": "0ff5wnrw7pfs80092r2iddacb3vi9a64s7j9im177897s55204fq",
"rev": "49d2a81d7a7a778eca4527868cf27e9298c5e7c8",
"sha256": "17707jc35xbbgn7bnmbfizpcn46hc51nbcz3rjvsizabl8bj8bk5",
"type": "tarball",
"url": "https://github.com/flopp/py-staticmaps/archive/cbe706fd266137cdf8a412f6ca54c02e4bc89fa6.tar.gz",
"url": "https://github.com/flopp/py-staticmaps/archive/49d2a81d7a7a778eca4527868cf27e9298c5e7c8.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"pyephem": {
diff --git a/nix/sources.nix b/nix/sources.nix
index 03676ae9a376b9b9b5d1774036fc78351b4006db..b796fffacd53b9df6434cce68006e7270833eaa1 100644
--- a/nix/sources.nix
+++ b/nix/sources.nix
@@ -1,82 +1,105 @@
let
builtins_fetchurl { inherit (spec) url sha256; }
pkgs.fetchurl { inherit (spec) url sha256; };
name' = sanitizeName name + "-src";
if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
else
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
builtins_fetchTarball { inherit (spec) url sha256; }
pkgs.fetchzip { inherit (spec) url sha256; };
name' = sanitizeName name + "-src";
if spec.builtin or true then
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
else
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
ref =
if spec ? ref then spec.ref else
if spec ? branch then "refs/heads/${spec.branch}" else
if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
''
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; };
builtin = true
. $ niv modify ${name} -a type=tarball -a builtin=true'';
''
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
''
(builtins_fetchurl { inherit (spec) url sha256; });
builtin = true
. $ niv modify ${name} -a type=file -a builtin=true'';
concatMapStrings (s: if builtins.isList s then "-" else s)
(
builtins.split "[^[:alnum:]+._?=-]+"
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
)
let
sourcesNixpkgs =
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { };
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
in
import <nixpkgs> { }
abort
''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';
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.
'';
fetch = pkgs: name: spec:
if ! builtins.hasAttr "type" spec then
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
else
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
if ersatz == "" then drv else ersatz;
@@ -85,44 +108,57 @@ f: set: with builtins;
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
);
let
inherit (builtins) lessThan nixVersion fetchTarball;
in
fetchTarball { inherit url; }
fetchTarball attrs;
if lessThan nixVersion "1.12" then
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
else
fetchTarball attrs;
let
inherit (builtins) lessThan nixVersion fetchurl;
in
fetchurl { inherit url; }
fetchurl attrs;
if lessThan nixVersion "1.12" then
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
else
fetchurl attrs;
mkSources = config:
(
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; }
)
config.sources;
name: spec:
if builtins.hasAttr "outPath" spec
then abort
"The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = replace name (fetch config.pkgs name spec); }
mkConfig =
}: rec {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;
@@ -130,5 +166,6 @@
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
inherit pkgs;
};
in
-mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); }
+mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
application/octet-stream
This content has been proxied by September (3851b).