3 target
=${target:-root@losurdo.sourcephile.fr}
4 # Compile the derivation of the new system
5 systemDrv
=$
(nix
-instantiate "${0%/*}".nix \
6 -A config.system.build.toplevel \
7 ${TRACE:+--show-trace} )
8 # Compile the build products of the new system
9 system
=$(nix-store --realise "$systemDrv")
11 nix copy
--to ssh://"$target" --substitute-on-destination "$system"
13 pass
"servers/losurdo/root/ssh/id_ed25519" |
14 ssh "$target" install -m 0400 -o root
-g root
/dev
/stdin \
16 # Register and switch to the new system
17 profile
=/nix
/var
/nix
/profiles
/system
18 ssh "$target" nix
-env --profile "$profile" --set "$system" \
19 '&&' nix
-env --profile "$profile" --delete-generations +5 \
20 '&&' "$profile"/bin
/switch
-to-configuration "${switch:-switch}"