From 89635cd5c911712952e9ebc6fe1da10abb734961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 26 Oct 2023 20:43:01 +0200 Subject: [PATCH] Fix baremetal deployment --- modules/autoupdate.nix | 2 +- packages.nix | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/autoupdate.nix b/modules/autoupdate.nix index a8b66e88..db0906ea 100644 --- a/modules/autoupdate.nix +++ b/modules/autoupdate.nix @@ -59,7 +59,7 @@ nix = { # Show a diff when activating a new system except for microvms which handle this seperately - diffSystem = config.c3d2.deployment.server == ""; + diffSystem = config.c3d2.deployment.server or "" == ""; gc = lib.mkIf config.c3d2.autoUpdate { automatic = true; randomizedDelaySec = "6h"; diff --git a/packages.nix b/packages.nix index a9668179..672263b8 100644 --- a/packages.nix +++ b/packages.nix @@ -110,16 +110,17 @@ lib.attrsets.mapAttrs "${name}-nixos-rebuild" = pkgs.writeScriptBin "${name}-nixos-rebuild" '' set -eou pipefail - ${lib.optionalString (hostConfig.c3d2.deployment.server != "") '' + ${lib.optionalString (hostConfig.c3d2.deployment.server or "" != "") '' echo "microvms cannot be updated with nixos-rebuild. Use nix run .#microvm-update-${name}" exit 2 ''} [[ $(ssh ${target} cat /etc/hostname) == ${name} ]] nix copy --no-check-sigs --to ssh-ng://${target} ${inputPaths} + nix copy --no-check-sigs --derivation --to ssh-ng://${target} ${discardStringCtx hostConfig.system.build.nixos-rebuild.drvPath} # use nixos-rebuild from target config - nixosRebuild=$(ssh ${target} nix build ${discardStringCtx hostConfig.system.build.nixos-rebuild.outPath or ""} ${overrideInputsArgs} --no-link --json | ${lib.getExe hostPkgs.jq} -r '.[0].outputs.out') + nixosRebuild=$(ssh ${target} nix build ${discardStringCtx hostConfig.system.build.nixos-rebuild.drvPath} ${overrideInputsArgs} --no-link --json | ${lib.getExe hostPkgs.jq} -r '.[0].outputs.out') ssh ${target} $nixosRebuild/bin/nixos-rebuild ${rebuildArg} "$@" '';