From 6c4cc2cd30d3b015cbb5595a7e6f18c07e973b96 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Wed, 2 Jul 2025 12:01:10 -0500 Subject: [PATCH] Rewrite deploy --- home/baseline/xonsh.nix | 1 - home/baseline/xonsh_footer.xsh | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/home/baseline/xonsh.nix b/home/baseline/xonsh.nix index 86960f1..5893947 100644 --- a/home/baseline/xonsh.nix +++ b/home/baseline/xonsh.nix @@ -56,7 +56,6 @@ s = "nix run \".#runserver\""; # Nix related ones - deploy = "nixos-rebuild switch --use-remote-sudo --use-substitutes --target-host"; gl-nging = "sudo nixos-container run gitlab -- systemctl restart nginx"; nb = "nix build -L"; nixdu = "sudo nix-store --gc --print-roots | egrep -v r\"^(/nix/var|/run/\\w+-system|\\{memory|/proc)\""; diff --git a/home/baseline/xonsh_footer.xsh b/home/baseline/xonsh_footer.xsh index e5246dc..b8ed214 100644 --- a/home/baseline/xonsh_footer.xsh +++ b/home/baseline/xonsh_footer.xsh @@ -63,6 +63,14 @@ def _rebuild(args): popd aliases['rebuild'] = _rebuild +def _deploy(args): + dest = args[0] + if dest != "linode": + nixos-rebuild switch --use-remote-sudo --use-substitutes --target-host @(dest) --build-host @(dest) + else: + nixos-rebuild swtich --use-remote-sudo --use-substitutes --target-host @(dest) +aliases['deploy'] = _deploy + def _yaml2json(args, stdin=None, stdout=None): import sys, yaml, json from yaml import CLoader