Skip to content

Commit 31f7f3f

Browse files
authored
nixForLinking: init (#384099)
2 parents 5084af7 + f4d32e0 commit 31f7f3f

File tree

7 files changed

+40
-17
lines changed

7 files changed

+40
-17
lines changed

pkgs/build-support/node/fetch-yarn-deps/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
makeSetupHook,
1919
cacert,
2020
callPackage,
21-
nix,
21+
nixForLinking,
2222
}:
2323

2424
let
@@ -55,7 +55,7 @@ in
5555
lib.makeBinPath [
5656
coreutils
5757
nix-prefetch-git
58-
nix
58+
nixForLinking
5959
]
6060
}
6161

pkgs/by-name/at/attic-client/package.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
lib,
33
rustPlatform,
44
fetchFromGitHub,
5-
nix,
5+
nixForLinking,
66
nixosTests,
77
boost,
88
pkg-config,
@@ -29,7 +29,7 @@ rustPlatform.buildRustPackage {
2929

3030
buildInputs =
3131
[
32-
nix
32+
nixForLinking
3333
boost
3434
]
3535
++ lib.optionals stdenv.hostPlatform.isDarwin (
@@ -44,7 +44,7 @@ rustPlatform.buildRustPackage {
4444
useFetchCargoVendor = true;
4545

4646
ATTIC_DISTRIBUTOR = "nixpkgs";
47-
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
47+
NIX_INCLUDE_PATH = "${lib.getDev nixForLinking}/include";
4848

4949
# Attic interacts with Nix directly and its tests require trusted-user access
5050
# to nix-daemon to import NARs, which is not possible in the build sandbox.

pkgs/by-name/nu/nurl/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
darwin,
99
gitMinimal,
1010
mercurial,
11-
nix,
11+
nixForLinking,
1212
}:
1313

1414
rustPlatform.buildRustPackage rec {
@@ -43,7 +43,7 @@ rustPlatform.buildRustPackage rec {
4343
lib.makeBinPath [
4444
gitMinimal
4545
mercurial
46-
nix
46+
nixForLinking
4747
]
4848
}
4949
installManPage artifacts/nurl.1

pkgs/development/tools/language-servers/nixd/default.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
llvmPackages,
99
meson,
1010
ninja,
11-
nix,
11+
nixForLinking,
1212
nix-update-script,
1313
nixd,
1414
nixf,
@@ -101,12 +101,12 @@ in
101101
];
102102

103103
buildInputs = [
104-
nix
104+
nixForLinking
105105
gtest
106106
boost
107107
];
108108

109-
env.CXXFLAGS = "-include ${nix.dev}/include/nix/config.h";
109+
env.CXXFLAGS = "-include ${nixForLinking.dev}/include/nix/config.h";
110110

111111
passthru.tests.pkg-config = testers.hasPkgConfigModules {
112112
package = nixt;
@@ -127,7 +127,7 @@ in
127127
sourceRoot = "${common.src.name}/nixd";
128128

129129
buildInputs = [
130-
nix
130+
nixForLinking
131131
nixf
132132
nixt
133133
llvmPackages.llvm
@@ -137,7 +137,7 @@ in
137137

138138
nativeBuildInputs = common.nativeBuildInputs ++ [ cmake ];
139139

140-
env.CXXFLAGS = "-include ${nix.dev}/include/nix/config.h";
140+
env.CXXFLAGS = "-include ${nixForLinking.dev}/include/nix/config.h";
141141

142142
# See https://github.com/nix-community/nixd/issues/519
143143
doCheck = false;

pkgs/tools/package-management/nix-du/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
stdenv,
44
fetchFromGitHub,
55
rustPlatform,
6-
nix,
6+
nixForLinking,
77
nlohmann_json,
88
boost,
99
graphviz,
@@ -27,13 +27,13 @@ rustPlatform.buildRustPackage rec {
2727

2828
doCheck = true;
2929
nativeCheckInputs = [
30-
nix
30+
nixForLinking
3131
graphviz
3232
];
3333

3434
buildInputs = [
3535
boost
36-
nix
36+
nixForLinking
3737
nlohmann_json
3838
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
3939

pkgs/tools/package-management/nix-prefetch-scripts/default.nix

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{ lib, stdenv, makeWrapper, buildEnv
2-
, bash, breezy, coreutils, cvs, findutils, gawk, git, git-lfs, gnused, mercurial, nix, subversion
2+
, bash, breezy, coreutils, cvs, findutils, gawk, git, git-lfs, gnused, mercurial
3+
, # FIXME: These scripts should not depend on Nix, they should depend on a
4+
# `.nar` hasher compatible with Nix.
5+
#
6+
# The fact that these scripts depend on Nix means that e.g. Chromium depends
7+
# on Nix.
8+
#
9+
# Also should be fixed:
10+
# - prefetch-yarn-deps
11+
# - nurl, nix-init
12+
#
13+
# Gridlock is one such candidate: https://github.com/lf-/gridlock
14+
nixForLinking
15+
, subversion
316
}:
417

518
let mkPrefetchScript = tool: src: deps:
@@ -15,7 +28,7 @@ let mkPrefetchScript = tool: src: deps:
1528
installPhase = ''
1629
install -vD ${src} $out/bin/$name;
1730
wrapProgram $out/bin/$name \
18-
--prefix PATH : ${lib.makeBinPath (deps ++ [ coreutils gnused nix ])} \
31+
--prefix PATH : ${lib.makeBinPath (deps ++ [ coreutils gnused nixForLinking ])} \
1932
--set HOME /homeless-shelter
2033
'';
2134

pkgs/top-level/all-packages.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17518,6 +17518,16 @@ with pkgs;
1751817518

1751917519
nix = nixVersions.stable;
1752017520

17521+
# Overlays for CppNix nightly, Lix, or Tvix want to change the default Nix
17522+
# implementation in Nixpkgs by overriding `pkgs.nix`. However, some packages
17523+
# link against the internal/unstable CppNix APIs directly, and these packages
17524+
# will break if built with different versions or implementations of Nix.
17525+
#
17526+
# If you want to swap out the Nix implementation in your package set, you
17527+
# don't want these packages to break. Therefore, some packages will refer to
17528+
# `nixForLinking` explicitly, at least until these dependencies can be sorted out.
17529+
nixForLinking = nixVersions.stable;
17530+
1752117531
nixStatic = pkgsStatic.nix;
1752217532

1752317533
lixVersions = recurseIntoAttrs (callPackage ../tools/package-management/lix {

0 commit comments

Comments
 (0)