From 083bef8dc6ad9cd197c25e201e30b1fbd60c4e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 10 Dec 2023 02:48:30 +0100 Subject: [PATCH] Fix quoting and shell code for local building --- packages.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages.nix b/packages.nix index 3a991091..434a8db7 100644 --- a/packages.nix +++ b/packages.nix @@ -93,7 +93,7 @@ lib.attrsets.mapAttrs let discardStringCtx = builtins.unsafeDiscardStringContext; host = getHostAddr name; - target = ''root@"${host}"''; + target = "root@${host}"; rebuildArg = "--flake ${self}#${name} ${overrideInputsArgs} --accept-flake-config"; hostConfig = self.nixosConfigurations."${name}".config; declaredRunnerDrvPath = discardStringCtx hostConfig.microvm.declaredRunner.drvPath; @@ -162,8 +162,8 @@ lib.attrsets.mapAttrs "${name}-nixos-rebuild-local" = pkgs.writeScriptBin "${name}-nixos-rebuild" '' set -eou pipefail - if [[ ''${1:-} == build; then - hostname=$(ssh root@${target} cat /etc/hostname)" + if [[ ''${1:-} == build ]]; then + hostname="$(ssh root@${target} cat /etc/hostname)" if [[ "$hostname" != ${name} ]]; then echo "hostname of ${target} was expected to be ${name} but is $hostname. Aborting to be safe..." exit 2