Skip to content

Commit

Permalink
use "source" for niv source names
Browse files Browse the repository at this point in the history
this removes a difference to how Nix currently fetches flake references.

using a constant is preferrable because renaming the source won't force
downstream rebuilds of store objects cached from when flakes were used.

upstream fix: nmattia/niv#379
  • Loading branch information
fricklerhandwerk committed Nov 7, 2023
1 parent 1e2299c commit 5337248
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions nix/sources.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@ let
#

fetch_file = pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
builtins_fetchurl { inherit (spec) url sha256; name = "source"; }
else
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
pkgs.fetchurl { inherit (spec) url sha256; name = "source"; };

fetch_tarball = pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
builtins_fetchTarball { name = "source"; inherit (spec) url sha256; }
else
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
pkgs.fetchzip { name = "source"; inherit (spec) url sha256; };

fetch_git = name: spec:
let
Expand Down

0 comments on commit 5337248

Please sign in to comment.