diff --git a/nix/sources.nix b/nix/sources.nix index 8a725cb..08002bb 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -21,27 +21,13 @@ let fetch_git = spec: builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; }; - fetch_builtin-tarball = spec: - builtins.trace - '' - WARNING: - The niv type "builtin-tarball" will soon be deprecated. You should - instead use `builtin = true`. + fetch_builtin-tarball = name: throw + ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; - $ niv modify -a type=tarball -a builtin=true - '' - builtins_fetchTarball { inherit (spec) url sha256; }; - - fetch_builtin-url = spec: - builtins.trace - '' - WARNING: - The niv type "builtin-url" will soon be deprecated. You should - instead use `builtin = true`. - - $ niv modify -a type=file -a builtin=true - '' - (builtins_fetchurl { inherit (spec) url sha256; }); + fetch_builtin-url = name: throw + ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; # # Various helpers @@ -74,8 +60,8 @@ let else if spec.type == "file" then fetch_file pkgs spec else if spec.type == "tarball" then fetch_tarball pkgs spec else if spec.type == "git" then fetch_git spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec - else if spec.type == "builtin-url" then fetch_builtin-url spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball name + else if spec.type == "builtin-url" then fetch_builtin-url name else abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; diff --git a/src/Niv/Sources.hs b/src/Niv/Sources.hs index 1386d3a..b26cf46 100644 --- a/src/Niv/Sources.hs +++ b/src/Niv/Sources.hs @@ -147,6 +147,7 @@ data SourcesNixVersion | V14 | V15 | V16 + | V17 deriving stock (Bounded, Enum, Eq) -- | A user friendly version @@ -168,6 +169,7 @@ sourcesVersionToText = \case V14 -> "14" V15 -> "15" V16 -> "16" + V17 -> "17" latestVersionMD5 :: T.Text latestVersionMD5 = sourcesVersionToMD5 maxBound @@ -196,6 +198,7 @@ sourcesVersionToMD5 = \case V14 -> "b470e235e7bcbf106d243fea90b6cfc9" V15 -> "dc11af910773ec9b4e505e0f49ebcfd2" V16 -> "2d93c52cab8e960e767a79af05ca572a" + V17 -> "149b8907f7b08dc1c28164dfa55c7fad" -- | The MD5 sum of ./nix/sources.nix sourcesNixMD5 :: IO T.Text