]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix nixops: allow keyFile to be a string in deployments
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 24 Apr 2019 23:34:35 +0000 (01:34 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 24 Apr 2019 23:34:35 +0000 (01:34 +0200)
default.nix
nixops/scripts/nixops_wrap

index 579dfaef8eddbf07cf98c4bf7146f8c6e859ac21..51ebcc23e646c0cb4b3f63703261d9d314ffc24c 100644 (file)
@@ -616,6 +616,11 @@ let
       '';
   });
 
+  mypkgs.nixops = nixops.overrideAttrs (old: {
+    preConfigure = (old.preConfigure or "") + ''
+      sed -i -e "/'keyFile'/s/'path'/'string'/" nixops/backends/__init__.py
+      '';
+  });
   mypkgs.flrn = let
     slang = stdenv.mkDerivation rec {
       name = "slang-debian-patched-${version}";
@@ -691,7 +696,6 @@ in
     inherit keybase;
     inherit bogofilter;
     inherit mtr;
-    inherit nixops;
     inherit urlview;
     inherit rr;
     inherit nix-zsh-completions;
index 3a894f9f2e01ac579db3e6d5a11b1055a0b1cb74..e4f5dc5e94c51f9df2f5f34c90ba5189a11e47f5 100755 (executable)
@@ -9,14 +9,16 @@ fi
 TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
 chmod go-rwx $TEMP
 
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
+
 finish() {
   rm -rf "$TEMP"
-  nixops set-args --unset privateFiles
+  $nixops set-args --unset privateFiles
 }
 
 trap finish EXIT
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
 export NIXOPS_DEPLOYMENT="$DeploymentUuid"
 
@@ -26,9 +28,9 @@ files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e '
 for file in $files; do
   pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files/$file" > $TEMP/$file
 done
-nixops set-args --argstr privateFiles "$TEMP"
+$nixops set-args --argstr privateFiles "$TEMP"
 
 source $(dirname $(dirname $DIR))/nix_path_env
 # __noChroot: ssh-config-file requires relaxed
 export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH"
-nixops "$@"
+$nixops "$@"