]>
Git — Sourcephile - sourcephile-nix.git/blob - servers/losurdo/deploy.sh
3 target
=${target:-root@losurdo.sourcephile.fr}
4 # Compile the derivation of the new system
5 system
=$(nix-instantiate "${0%/*}".nix -A config.system.build.toplevel)
6 # Compile the build products of the new system
7 nix
-store --realise "$system"
9 nix
-copy-closure --to "$target" --use-substitutes --gzip "$system"
10 # Register the new system
11 profile
=/nix
/var
/nix
/profiles
/system
12 ssh "$target" nix
-env --profile "$profile" --set "$system" \
13 '&&' nix
-env --profile "$profile" --delete-generations +5
15 pass
"servers/losurdo/root/ssh/id_ed25519" |
16 ssh "$target" install -m 0400 -o root
-g root
/dev
/stdin \
18 # Switch to the new system
19 ssh "$target" "$profile"/bin
/switch
-to-configuration switch