just: improve push

This commit is contained in:
Peder Bergebakken Sundt 2024-03-02 15:16:04 +01:00
parent 334b7cf7bd
commit 3b62429e73
2 changed files with 8 additions and 2 deletions

View File

@ -296,7 +296,11 @@
in {
# TODO: get faketty to work ${expect}/bin/unbuffer is bad
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
exec ${lib.getExe pkgs.nixos-rebuild} "$@" |& ${lib.getExe pkgs.nix-output-monitor}
if test -t 1 || test -z "''${NIX_NO_NOM-}"; then
exec ${lib.getExe pkgs.nixos-rebuild} "$@" -L |& ${lib.getExe pkgs.nix-output-monitor}
else
exec ${lib.getExe pkgs.nixos-rebuild} "$@" -L
fi
'';
nspawn-setup-brumlebasse = mk-nspawn-deployer "brumlebasse";

View File

@ -33,7 +33,9 @@ boot:
sudo nixos-rebuild boot --flake .
push hostname=`just _a-host` cmd=`gum choose test switch boot --header "Select mode..."`:
nixos-rebuild --flake .#{{hostname}} --target-host root@$(nix eval .#nixosReports.{{hostname}}.fqdn --json | jq . -r) --use-substitutes {{cmd}}
nixos-rebuild build --flake .#{{hostname}}
@echo pushing...
NIX_NO_NOM=1 NIX_SSHOPTS="-tt" nixos-rebuild {{cmd}} --flake .#{{hostname}} --use-remote-sudo --target-host $(nix eval .#nixosReports.{{hostname}}.fqdn --json | jq . -r) --use-substitutes
@_a-host:
nix eval .#nixosReports --apply builtins.attrNames --json 2>/dev/null | jq '.[]' -r | gum filter --placeholder "Pick a host..."