mirror of
https://github.com/nmattia/niv.git
synced 2024-09-19 11:27:40 +03:00
Allow setting custom pkgs
This commit is contained in:
parent
56e3f877ad
commit
0e460c49de
@ -125,11 +125,14 @@ let
|
|||||||
# The "config" used by the fetchers
|
# The "config" used by the fetchers
|
||||||
mkConfig =
|
mkConfig =
|
||||||
{ sourcesFile ? ./sources.json
|
{ sourcesFile ? ./sources.json
|
||||||
|
, sources ? builtins.fromJSON (builtins.readFile sourcesFile)
|
||||||
|
, pkgs ? mkPkgs sources
|
||||||
}: rec {
|
}: rec {
|
||||||
# The sources, i.e. the attribute set of spec name to spec
|
# 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
|
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
|
||||||
pkgs = mkPkgs sources;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
|
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
|
||||||
|
@ -145,6 +145,7 @@ data SourcesNixVersion
|
|||||||
| V12
|
| V12
|
||||||
| V13
|
| V13
|
||||||
| V14
|
| V14
|
||||||
|
| V15
|
||||||
deriving stock (Bounded, Enum, Eq)
|
deriving stock (Bounded, Enum, Eq)
|
||||||
|
|
||||||
-- | A user friendly version
|
-- | A user friendly version
|
||||||
@ -164,6 +165,7 @@ sourcesVersionToText = \case
|
|||||||
V12 -> "12"
|
V12 -> "12"
|
||||||
V13 -> "13"
|
V13 -> "13"
|
||||||
V14 -> "14"
|
V14 -> "14"
|
||||||
|
V15 -> "15"
|
||||||
|
|
||||||
latestVersionMD5 :: T.Text
|
latestVersionMD5 :: T.Text
|
||||||
latestVersionMD5 = sourcesVersionToMD5 maxBound
|
latestVersionMD5 = sourcesVersionToMD5 maxBound
|
||||||
@ -190,6 +192,7 @@ sourcesVersionToMD5 = \case
|
|||||||
V12 -> "2f9629ad9a8f181ed71d2a59b454970c"
|
V12 -> "2f9629ad9a8f181ed71d2a59b454970c"
|
||||||
V13 -> "5e23c56b92eaade4e664cb16dcac1e0a"
|
V13 -> "5e23c56b92eaade4e664cb16dcac1e0a"
|
||||||
V14 -> "b470e235e7bcbf106d243fea90b6cfc9"
|
V14 -> "b470e235e7bcbf106d243fea90b6cfc9"
|
||||||
|
V15 -> "dc11af910773ec9b4e505e0f49ebcfd2"
|
||||||
|
|
||||||
-- | The MD5 sum of ./nix/sources.nix
|
-- | The MD5 sum of ./nix/sources.nix
|
||||||
sourcesNixMD5 :: IO T.Text
|
sourcesNixMD5 :: IO T.Text
|
||||||
|
Loading…
Reference in New Issue
Block a user