diff --git a/CHANGELOG.md b/CHANGELOG.md index c89bd17..af6dbbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.2.11] 2020-01-07 +## Changed +* Users can set custom `pkgs` when `import`ing `sources.nix` + ## [0.2.10] 2020-01-06 ## Changed * The bundled `nix/sources.nix` is formatted with `nixpkgs-fmt` diff --git a/README.md b/README.md index fb936a9..375669b 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ $ niv update ghc -v 8.6.2 ``` niv - dependency manager for Nix projects -version: 0.2.10 +version: 0.2.11 Usage: niv [-s|--sources-file FILE] COMMAND diff --git a/nix/sources.nix b/nix/sources.nix index b53359f..6e2bf23 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -125,11 +125,14 @@ let # The "config" used by the fetchers mkConfig = { sourcesFile ? ./sources.json + , sources ? builtins.fromJSON (builtins.readFile sourcesFile) + , pkgs ? mkPkgs sources }: rec { # The sources, i.e. the attribute set of spec name to spec - sources = builtins.fromJSON (builtins.readFile sourcesFile); + inherit sources; + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers - pkgs = mkPkgs sources; + inherit pkgs; }; in mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/package.yaml b/package.yaml index cfd2326..5e43b7b 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: niv -version: 0.2.10 +version: 0.2.11 license: MIT author: Nicolas Mattia maintainer: Nicolas Mattia diff --git a/script/gen b/script/gen index 82daec0..75a53e4 100755 --- a/script/gen +++ b/script/gen @@ -3,10 +3,6 @@ #!nix-shell -I nixpkgs=./nix #!nix-shell -p nix #!nix-shell --keep GITHUB_TOKEN -#!nix-shell --pure - -unset NIX_SSL_CERT_FILE -unset SSL_CERT_FILE set -euo pipefail diff --git a/script/test b/script/test index 381f293..08b192e 100755 --- a/script/test +++ b/script/test @@ -3,10 +3,6 @@ #!nix-shell -I nixpkgs=./nix #!nix-shell -p nix #!nix-shell -p nixpkgs-fmt -#!nix-shell --pure - -unset NIX_SSL_CERT_FILE -unset SSL_CERT_FILE set -euo pipefail diff --git a/src/Niv/Sources.hs b/src/Niv/Sources.hs index 2c9ec14..d16eee2 100644 --- a/src/Niv/Sources.hs +++ b/src/Niv/Sources.hs @@ -145,6 +145,7 @@ data SourcesNixVersion | V12 | V13 | V14 + | V15 deriving stock (Bounded, Enum, Eq) -- | A user friendly version @@ -164,6 +165,7 @@ sourcesVersionToText = \case V12 -> "12" V13 -> "13" V14 -> "14" + V15 -> "15" latestVersionMD5 :: T.Text latestVersionMD5 = sourcesVersionToMD5 maxBound @@ -190,6 +192,7 @@ sourcesVersionToMD5 = \case V12 -> "2f9629ad9a8f181ed71d2a59b454970c" V13 -> "5e23c56b92eaade4e664cb16dcac1e0a" V14 -> "b470e235e7bcbf106d243fea90b6cfc9" + V15 -> "dc11af910773ec9b4e505e0f49ebcfd2" -- | The MD5 sum of ./nix/sources.nix sourcesNixMD5 :: IO T.Text