about summary refs log tree commit diff
path: root/users/sterni/machines
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni/machines')
-rw-r--r--users/sterni/machines/default.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/users/sterni/machines/default.nix b/users/sterni/machines/default.nix
index 4a859a337a22..291d9756c7e3 100644
--- a/users/sterni/machines/default.nix
+++ b/users/sterni/machines/default.nix
@@ -10,9 +10,13 @@ let
     (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./.));
 
   # TODO(sterni): share code with rebuild-system
-  localDeployScriptFor = { system, ... }:
+  localDeployScriptFor = { system, config, ... }:
     pkgs.writeShellScript "local-deploy-${system.name}" ''
       set -eu
+      if [[ "$(hostname)" != "${config.networking.hostName}" ]]; then
+        echo "$0: unexpected hostname: $(hostname). Are you deploying on the right machine?"
+        exit 1
+      fi
       nix-env -p /nix/var/nix/profiles/system --set "${system}"
       "${system}/bin/switch-to-configuration" switch
     '';