{ inputs, pkgs, ... }:
pkgs.writeShellApplication {
  name = "update-instance";
  runtimeInputs = [ pkgs.nixos-rebuild ];
  text = ''
    instance="''${1:-}"
    connect_host="''${2:-$1}"
    nixos-rebuild switch --flake "${inputs.self}#$instance" --target-host "$connect_host" --build-host "localhost"
  '';
}
