From 0eb36bccc84742ce292e1ea382fba7aae678c685 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 29 Apr 2026 12:47:50 +0000 Subject: [PATCH] incus-vm: fix attic post-build hook (use login+push, not --server flag) --- registry/bpmct/templates/incus-vm/nixos.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registry/bpmct/templates/incus-vm/nixos.tf b/registry/bpmct/templates/incus-vm/nixos.tf index 85e1e74f..67bb1bd0 100644 --- a/registry/bpmct/templates/incus-vm/nixos.tf +++ b/registry/bpmct/templates/incus-vm/nixos.tf @@ -70,7 +70,8 @@ resource "null_resource" "provision_nixos" { # Write the attic post-build hook script. # Runs after every nix build and pushes new store paths to the cache. - printf '#!/bin/sh\nset -eu\nexport HOME=/root\nexport ATTIC_SERVER="%s"\n[ -f /etc/nix/attic-token ] && TOKEN=$(cat /etc/nix/attic-token) || exit 0\n/run/current-system/sw/bin/attic --server "$ATTIC_SERVER" push %s $OUT_PATHS 2>&1 || true\n' \ + # attic-client uses `attic login ` + `attic push :`. + printf '#!/bin/sh\nset -eu\nexport HOME=/root\nATTIC_URL="%s"\nATTIC_CACHE="%s"\n[ -f /etc/nix/attic-token ] || exit 0\nTOKEN=$(cat /etc/nix/attic-token)\n/run/current-system/sw/bin/attic login thinkstation "$ATTIC_URL" "$TOKEN" 2>/dev/null || true\n/run/current-system/sw/bin/attic push "thinkstation:$ATTIC_CACHE" $OUT_PATHS 2>&1 || true\n' \ "$ATTIC_URL" "$ATTIC_CACHE" \ | incus file push - "$REMOTE:$INSTANCE/etc/nix/post-build-hook.sh" --mode 0755