From d427a483e247d20f82cf40b719fd1d77ddb2cf84 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sat, 6 Nov 2021 18:18:37 +0300 Subject: [PATCH] Use a proper-ish fix for the path cannot have references thingy --- flake.lock | 14 ++++++++------ flake.nix | 1 + profiles/nix/default.nix | 4 +--- profiles/nix/nix.patch | 17 ----------------- profiles/nix/unset-is-macho.patch | 13 ------------- 5 files changed, 10 insertions(+), 39 deletions(-) delete mode 100644 profiles/nix/unset-is-macho.patch diff --git a/flake.lock b/flake.lock index bed7110..3fdb015 100644 --- a/flake.lock +++ b/flake.lock @@ -370,16 +370,18 @@ "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1635424607, - "narHash": "sha256-Yumem7c3rcngTaPtUc/yms3Imi5P6dVMPmy0GnHyCWw=", - "owner": "NixOS", + "lastModified": 1636141290, + "narHash": "sha256-mQ+qS1oTnxBDWUUT1kr7QzjUz4K35JDFdO8ELsfCEgk=", + "owner": "tweag", "repo": "nix", - "rev": "bc4b7521f4a72de1d7a9db0b5be76885e0729e7c", + "rev": "9d4dcff37a14c5bab98761e417a2335a9ac68c96", "type": "github" }, "original": { - "id": "nix", - "type": "indirect" + "owner": "tweag", + "ref": "balsoft/allow-references-in-addPath", + "repo": "nix", + "type": "github" } }, "nix-direnv": { diff --git a/flake.nix b/flake.nix index f912792..0c50182 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nix.url = "github:tweag/nix?ref=balsoft/allow-references-in-addPath"; lambda-launcher.url = "github:balsoft/lambda-launcher"; deploy-rs.url = "github:serokell/deploy-rs"; flake-compat = { diff --git a/profiles/nix/default.nix b/profiles/nix/default.nix index 77d2f0f..76094d0 100644 --- a/profiles/nix/default.nix +++ b/profiles/nix/default.nix @@ -24,9 +24,7 @@ ]; package = inputs.nix.defaultPackage.${pkgs.system}.overrideAttrs (oa: { - patches = [ ./nix.patch ./unset-is-macho.patch ] ++ oa.patches or [ ]; - # HAHA - doInstallCheck = false; + patches = [ ./nix.patch ] ++ oa.patches or [ ]; }); extraOptions = '' diff --git a/profiles/nix/nix.patch b/profiles/nix/nix.patch index 506fcfb..0702778 100644 --- a/profiles/nix/nix.patch +++ b/profiles/nix/nix.patch @@ -40,20 +40,3 @@ 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 deleted file mode 100644 index f79c578..0000000 --- a/profiles/nix/unset-is-macho.patch +++ /dev/null @@ -1,13 +0,0 @@ -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