]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix setup script using nixpos_custom
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 May 2019 21:56:22 +0000 (23:56 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 May 2019 21:56:22 +0000 (23:56 +0200)
nixops/scripts/setup
scripts/nix_env

index cc0348286a6100f087658700b5e0d5e928c3f714..dce8332f7284308b39e01ed65732f3d8ecf38b72 100755 (executable)
@@ -94,9 +94,9 @@ if nix show-config --json | jq -e '.sandbox.value == "true"' >/dev/null; then
 fi
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-source $(dirname $(dirname $DIR))/scripts/nix_env
 export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
 export NIXOPS_DEPLOYMENT="$DeploymentUuid"
+source $(dirname $(dirname $DIR))/scripts/nix_env
 
 if ! nixops_custom info 2>/dev/null >/dev/null; then
   cat <<-EOF
index 6326243b6bb694a7b2505b663f67f0aef8b5f481..fc6557cf75a8d61ad1bfefdefb9a3aa04dac470f 100644 (file)
@@ -11,7 +11,7 @@ nixpkgsNext="$nixpkgs"
 export NIX_PATH="nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext:nixpkgsPrevious=$nixpkgsPrevious"
 
 nixops_custom () {
-  DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-  d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $(dirname $DIR)/overlays); }; nixops")
+  _DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+  d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $(dirname $_DIR)/overlays); }; nixops")
   ${d}/bin/nixops "$@"
 }