1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-07 22:36:53 +03:00

Merge pull request #33 from nlewo/cleaning

sources.nix: cleaning
This commit is contained in:
Nicolas Mattia 2019-03-13 12:52:41 +01:00 committed by GitHub
commit fc58efb5ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -608,6 +608,8 @@ pathNixSourcesNix = "nix" </> "sources.nix"
-- | Glue code between nix and sources.json
initNixSourcesNixContent :: String
initNixSourcesNixContent = [s|
# This file has been generated by Niv.
# A record, from name to path, of the third-party packages
with rec
{
@ -615,13 +617,6 @@ with rec
sources = builtins.fromJSON (builtins.readFile ./sources.json);
# fetchTarball version that is compatible between all the sources of Nix
fetchTarball =
{ url, sha256 }:
if builtins.lessThan builtins.nixVersion "1.12" then
builtins.fetchTarball { inherit url; }
else
builtins.fetchTarball { inherit url sha256; };
mapAttrs = builtins.mapAttrs or
(f: set: with builtins;
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)));