summaryrefslogtreecommitdiff
path: root/push
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-11-10 17:30:15 -0800
committerBen Sima <ben@bsima.me>2019-11-10 17:30:15 -0800
commit47630969d373b27d16ff5d3313b3129c8bec8fa8 (patch)
tree51f227f6b6807f112449c8b0d6cd87e283d96d2b /push
parent0f8f6fdeaa0af21b512e74ef0bc450089f46145f (diff)
set the profile after switching to new configuration
Without this, the system will revert to the original profile set with the last nixos-rebuild command, which was probably a nixos-infect. This is probbaly why I lost access to the first serval machine.
Diffstat (limited to 'push')
-rwxr-xr-xpush5
1 files changed, 3 insertions, 2 deletions
diff --git a/push b/push
index 81ad75f..8b1814e 100755
--- a/push
+++ b/push
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
where="$1"
-what="$2"
+what=$(realpath "$2")
nix copy --to ssh://root@$where $what
-ssh root@$where $(realpath $what)/bin/switch-to-configuration switch
+ssh root@$where $what/bin/switch-to-configuration switch
+ssh root@$where nix-env --profile /nix/var/nix/profiles/system --set $what