From 436c7476869713d4366553a6d846404cd76319d4 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Wed, 27 Oct 2021 14:22:26 +0300 Subject: [PATCH] update nix --- profiles/nix/default.nix | 6 ++++-- profiles/nix/nix.patch | 17 +++++++++++++++++ profiles/nix/unset-is-macho.patch | 13 +++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 profiles/nix/unset-is-macho.patch diff --git a/profiles/nix/default.nix b/profiles/nix/default.nix index 70843e2..3d9feda 100644 --- a/profiles/nix/default.nix +++ b/profiles/nix/default.nix @@ -7,6 +7,7 @@ "https://nix-community.cachix.org" ]; binaryCachePublicKeys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nixos-rocm.cachix.org-1:VEpsf7pRIijjd8csKjFNBGzkBqOmw8H9PRmgAq14LnE=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; @@ -20,8 +21,9 @@ autoOptimiseStore = false; - package = inputs.nix.packages.${system}.nix.overrideAttrs (oa: { - patches = [ ./nix.patch ] ++ oa.patches or []; + package = inputs.nix.defaultPackage.x86_64-linux.overrideAttrs (oa: { + patches = [ ./nix.patch ./unset-is-macho.patch ] ++ oa.patches or [ ]; + doInstallCheck = false; }); extraOptions = '' diff --git a/profiles/nix/nix.patch b/profiles/nix/nix.patch index 0702778..506fcfb 100644 --- a/profiles/nix/nix.patch +++ b/profiles/nix/nix.patch @@ -40,3 +40,20 @@ index e04954d45..5649bd01a 100644 globals.dryRun = false; globals.preserveInstalled = false; globals.removeAll = false; +diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc +index f27331534..386a664d9 100644 +--- a/src/libexpr/primops.cc ++++ b/src/libexpr/primops.cc +@@ -1862,9 +1862,9 @@ static void addPath( + if (state.store->isInStore(path)) { + auto [storePath, subPath] = state.store->toStorePath(path); + auto info = state.store->queryPathInfo(storePath); +- if (!info->references.empty()) +- throw EvalError("store path '%s' is not allowed to have references", +- state.store->printStorePath(storePath)); ++ // if (!info->references.empty()) ++ // throw EvalError("store path '%s' is not allowed to have references", ++ // state.store->printStorePath(storePath)); + path = state.store->toRealPath(storePath) + subPath; + } + diff --git a/profiles/nix/unset-is-macho.patch b/profiles/nix/unset-is-macho.patch new file mode 100644 index 0000000..f79c578 --- /dev/null +++ b/profiles/nix/unset-is-macho.patch @@ -0,0 +1,13 @@ +diff --git a/src/nix/get-env.sh b/src/nix/get-env.sh +index 42c806450..a8563c772 100644 +--- a/src/nix/get-env.sh ++++ b/src/nix/get-env.sh +@@ -8,6 +8,8 @@ if [[ -n $stdenv ]]; then + source $stdenv/setup + fi + ++unset -f isMachO ++ + # Better to use compgen, but stdenv bash doesn't have it. + __vars="$(declare -p)" + __functions="$(declare -F)" \ No newline at end of file