aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/update_hosts.remote
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-10-29 21:26:50 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-27 00:27:16 +0100
commite0e16b1e0d7ac45fdded132ce7c3844c8535dcfc (patch)
treea6ee999a3e595c89d95e78a6b38174783b14dbac /scripts/update_hosts.remote
parentinputs.nix: Really deduplicate all nixpkgs/nixos inputs (diff)
downloadnixos-server-e0e16b1e0d7ac45fdded132ce7c3844c8535dcfc.zip
scripts/update_hosts.sh: Update to use `deploy-rs`
Diffstat (limited to 'scripts/update_hosts.remote')
-rw-r--r--scripts/update_hosts.remote48
1 files changed, 0 insertions, 48 deletions
diff --git a/scripts/update_hosts.remote b/scripts/update_hosts.remote
deleted file mode 100644
index 7385129..0000000
--- a/scripts/update_hosts.remote
+++ /dev/null
@@ -1,48 +0,0 @@
-#! /usr/bin/env sh
-
-# This is the remote side of `update_hosts.sh`, it will be copied to the remote host
-# and is responsible for performing the update.
-
-set -e
-
-PATH_add() {
- nix_expr="$1"
- what="$(nix build "nixpkgs#$nix_expr.out" --print-out-paths --no-link)"
-
- printf "Adding '%s' (%s/bin) to PATH..\n" "$nix_expr" "$what"
-
- PATH="$what/bin:$PATH"
- export PATH
-}
-
-branch="$1"
-flake_path="${2-""}"
-
-# We don't have access to git by default, so evaluate it here
-PATH_add git
-
-# By-default these systems use cppnix, which can't build our config. So let's switch to
-# lix.
-PATH_add lixPackageSets.latest.lix
-
-# We might or might not have python, and we need it, because we use the unwrapped
-# `nixos-update`.
-PATH_add python3
-PATH_add nixos-rebuild
-
-if [ -z "$flake_path" ]; then
- set -x
- cd /etc/nixos
-
- sudo git fetch --all --prune
- sudo git switch "$branch"
- sudo git pull --rebase
-
- 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