From b3c4903c82f85c5a195f763b1f9c746149e0d886 Mon Sep 17 00:00:00 2001 From: alexion Date: Wed, 7 Oct 2026 17:43:20 -0400 Subject: [PATCH] fix(fish): persist remote system deployments --- configs/nixos/AGENTS.md | 5 +++-- configs/nixos/modules/shell/fish/functions/deploy-to.fish | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configs/nixos/AGENTS.md b/configs/nixos/AGENTS.md index cd8c10f..2f538cf 100644 --- a/configs/nixos/AGENTS.md +++ b/configs/nixos/AGENTS.md @@ -52,8 +52,8 @@ directories already exist inside the read-only source. For aggregate Copyparty volumes such as `/srv` with nested `/srv/inbox`, keep the guest bind mount writable and enforce read-only behavior through Copyparty access plus service `ReadWritePaths`. -- `deploy-to` builds from the source checkout and activates an imported closure on the target. - Do not rely on a target-local monorepo checkout for remote deployment. +- `deploy-to` builds from the source checkout, records the imported closure as the target system profile, + and activates it. Do not rely on a target-local monorepo checkout for remote deployment. - On Pikachu, `nix copy --to ssh://pikachu` accepted a small `nix store add-file` probe, but rejected locally built system paths that lacked trusted signatures. Use a sudo `nix-store --import` path for unsigned deploy closures. @@ -64,3 +64,4 @@ - Configure the Chaotic Nyx cache only on hosts that select `linuxPackages_cachyos` (currently Neogaia and Zeus), not in the generic host module. - Module-relative paths resolve from the module file. Update them when moving a module into a subdirectory. +- On Pikachu, `uptime` does not support `-s`. Use `who -b` to report the boot time. diff --git a/configs/nixos/modules/shell/fish/functions/deploy-to.fish b/configs/nixos/modules/shell/fish/functions/deploy-to.fish index d4f4b52..525717c 100644 --- a/configs/nixos/modules/shell/fish/functions/deploy-to.fish +++ b/configs/nixos/modules/shell/fish/functions/deploy-to.fish @@ -80,6 +80,13 @@ else echo "deploy-to: $host already has the full closure for $system_path" >&2 end +echo "deploy-to: recording $system_path as the system profile on $host" >&2 +ssh -t $host sudo nix-env --profile /nix/var/nix/profiles/system --set $system_path +or begin + echo "deploy-to: system profile update failed for $host" >&2 + return $status +end + echo "deploy-to: activating $system_path on $host" >&2 ssh -t $host sudo "$system_path/bin/switch-to-configuration" switch or begin -- 2.47.3