Skip to content

Commit

Permalink
nixos_rebuild: allow changing deployment method
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Jul 12, 2024
1 parent 86bb3cf commit 51f16df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion roles/nixos_rebuild/templates/script.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ fi
export ANSIBLE_JSON={{ loc_json | quote }}

if [ -v NIXOS_ANYWHERE ]; then
if [ -v NIXOS_METHOD ]; then
echo "ERR: Method not supported for NIXOS_ANYWHERE!" >&2
fi
{{ nix_wrapper | quote }} nix run github:nix-community/nixos-anywhere -- --option pure-eval "false" --flake {{ flake_url | quote }} {{ target_host | quote }}
else
{{ nix_wrapper | quote }} nix run nixpkgs#nixos-rebuild -- --flake {{ flake_url | quote }} "switch" --use-substitutes --impure --target-host {{ target_host | quote }} --show-trace
{{ nix_wrapper | quote }} nix run nixpkgs#nixos-rebuild -- --flake {{ flake_url | quote }} "${NIXOS_METHOD:-switch}" --use-substitutes --impure --target-host {{ target_host | quote }} --show-trace
fi

0 comments on commit 51f16df

Please sign in to comment.