diff options
Diffstat (limited to '')
| -rw-r--r-- | scripts/update_hosts.remote | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/update_hosts.remote b/scripts/update_hosts.remote index 249b24e..7385129 100644 --- a/scripts/update_hosts.remote +++ b/scripts/update_hosts.remote @@ -16,6 +16,7 @@ PATH_add() { } branch="$1" +flake_path="${2-""}" # We don't have access to git by default, so evaluate it here PATH_add git @@ -29,13 +30,19 @@ PATH_add lixPackageSets.latest.lix PATH_add python3 PATH_add nixos-rebuild -set -x -cd /etc/nixos +if [ -z "$flake_path" ]; then + set -x + cd /etc/nixos -sudo git fetch --all --prune -sudo git switch "$branch" -sudo git pull --rebase + sudo git fetch --all --prune + sudo git switch "$branch" + sudo git pull --rebase -PYTHONNOUSERSITE='true' sudo --preserve-env=PATH --preserve-env=PYTHONNOUSERSITE ".nixos-rebuild-wrapped" --no-reexec boot + flake_path="git+file:/etc/nixos/" +fi + +# we use the unwrapped one, to make sure that we are really using lix (otherwise it might +# be wrapped with cppnix). +PYTHONNOUSERSITE='true' sudo --preserve-env=PATH --preserve-env=PYTHONNOUSERSITE ".nixos-rebuild-wrapped" --flake "$flake_path" --no-reexec boot sudo reboot |
