Skip to content

Commit

Permalink
nix{,Unstable}: pass pname, version to mkDerivation
Browse files Browse the repository at this point in the history
This allows stdenv.mkDerivation to append -static to the name for
pkgsStatic.nix / nixStatic which should make nix-env stop thinking
that nixStatic is a newer version of nix.

This change replaces NixOS#119310.
  • Loading branch information
sternenseemann committed Apr 13, 2021
1 parent 851c0f1 commit f4e8746
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkgs/tools/package-management/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ common =
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
, withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp
, enableStatic ? stdenv.hostPlatform.isStatic
, name, suffix ? "", src
, pname, version, suffix ? "", src
, patches ? [ ]
}:
let
sh = busybox-sandbox-shell;
nix = stdenv.mkDerivation rec {
inherit name src patches;
version = lib.getVersion name;
inherit pname version src patches;

is24 = lib.versionAtLeast version "2.4pre";

Expand Down Expand Up @@ -196,9 +195,10 @@ in rec {
nix = nixStable;

nixStable = callPackage common (rec {
name = "nix-2.3.10";
pname = "nix";
version = "2.3.10";
src = fetchurl {
url = "https://nixos.org/releases/nix/${name}/${name}.tar.xz";
url = "https://nixos.org/releases/nix/${pname}-${version}/${pname}-${version}.tar.xz";
sha256 = "a8a85e55de43d017abbf13036edfb58674ca136691582f17080c1cd12787b7ab";
};

Expand All @@ -213,7 +213,8 @@ in rec {
});

nixUnstable = lib.lowPrio (callPackage common rec {
name = "nix-2.4${suffix}";
pname = "nix";
version = "2.4${suffix}";
suffix = "pre20210326_dd77f71";

src = fetchFromGitHub {
Expand Down

0 comments on commit f4e8746

Please sign in to comment.