Unverified Commit f4d32e02 authored by Rebecca Turner's avatar Rebecca Turner
Browse files

nixForLinking: init

Overlays for CppNix nightly, Lix, or Tvix want to change the default Nix
implementation in Nixpkgs by overriding `pkgs.nix`. However, some
packages link against the internal/unstable CppNix APIs directly, and
these packages will break if built with different versions or
implementations of Nix.

If you want to swap out the Nix implementation in your package set, you
don't want these packages to break. Therefore, some packages will refer
to `nixForLinking` explicitly, at least until these dependencies can be
sorted out.

The addition of an explicit `nixForLinking` attribute decoupled from
`nix`, which is just "a Nix implementation", will help Nix
implementation maintainers test Nix implementations in Nixpkgs with
minimal hassle.
parent 63d0ef62
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
  makeSetupHook,
  cacert,
  callPackage,
  nix,
  nixForLinking,
}:

let
@@ -54,7 +54,7 @@ in
          lib.makeBinPath [
            coreutils
            nix-prefetch-git
            nix
            nixForLinking
          ]
        }

+3 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
  lib,
  rustPlatform,
  fetchFromGitHub,
  nix,
  nixForLinking,
  nixosTests,
  boost,
  pkg-config,
@@ -29,7 +29,7 @@ rustPlatform.buildRustPackage {

  buildInputs =
    [
      nix
      nixForLinking
      boost
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin (
@@ -44,7 +44,7 @@ rustPlatform.buildRustPackage {
  useFetchCargoVendor = true;

  ATTIC_DISTRIBUTOR = "nixpkgs";
  NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
  NIX_INCLUDE_PATH = "${lib.getDev nixForLinking}/include";

  # Attic interacts with Nix directly and its tests require trusted-user access
  # to nix-daemon to import NARs, which is not possible in the build sandbox.
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
  darwin,
  gitMinimal,
  mercurial,
  nix,
  nixForLinking,
}:

rustPlatform.buildRustPackage rec {
@@ -47,7 +47,7 @@ rustPlatform.buildRustPackage rec {
        lib.makeBinPath [
          gitMinimal
          mercurial
          nix
          nixForLinking
        ]
      }
    installManPage artifacts/nurl.1
+5 −5
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
  llvmPackages,
  meson,
  ninja,
  nix,
  nixForLinking,
  nix-update-script,
  nixd,
  nixf,
@@ -101,12 +101,12 @@ in
      ];

      buildInputs = [
        nix
        nixForLinking
        gtest
        boost
      ];

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

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

      buildInputs = [
        nix
        nixForLinking
        nixf
        nixt
        llvmPackages.llvm
@@ -137,7 +137,7 @@ in

      nativeBuildInputs = common.nativeBuildInputs ++ [ cmake ];

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

      # See https://github.com/nix-community/nixd/issues/519
      doCheck = false;
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
  stdenv,
  fetchFromGitHub,
  rustPlatform,
  nix,
  nixForLinking,
  nlohmann_json,
  boost,
  graphviz,
@@ -27,13 +27,13 @@ rustPlatform.buildRustPackage rec {

  doCheck = true;
  nativeCheckInputs = [
    nix
    nixForLinking
    graphviz
  ];

  buildInputs = [
    boost
    nix
    nixForLinking
    nlohmann_json
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];

Loading