Skip to content

Commit

Permalink
build: customize buildhosts on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
meatcar committed Dec 21, 2023
1 parent da72862 commit 3dfd049
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@
FLAKE="$1"; shift 1
REMOTE_HOST=
REMOTE_OPTS= # opts to pass to nixos-rebuild
BUILD_HOST=
case "$FLAKE" in
chunkymonkey)
REMOTE_HOST=chunkymonkey.fish-hydra.ts.net
BUILD_HOST="$REMOTE_HOST"
;;
vps)
REMOTE_HOST=$(cd terraform && ${pkgs.terraform}/bin/terraform output --raw ip)
BUILD_HOST="$REMOTE_HOST"
;;
cube)
REMOTE_HOST=cube.fish-hydra.ts.net
REMOTE_OPTS=--impure
BUILD_HOST="$REMOTE_HOST"
;;
*)
echo no such remote host "$FLAKE" >&2
Expand All @@ -60,7 +64,7 @@
cmd=$(echo nixos-rebuild "$@" \
--flake .#"$FLAKE" \
--target-host "$REMOTE_HOST" \
--build-host "$REMOTE_HOST" \
--build-host "$BUILD_HOST" \
--use-remote-sudo \
--use-substitutes $REMOTE_OPTS)
echo "$cmd"
Expand Down

0 comments on commit 3dfd049

Please sign in to comment.