about summary refs log tree commit diff
path: root/ops
diff options
context:
space:
mode:
Diffstat (limited to 'ops')
-rw-r--r--ops/modules/auto-deploy.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/ops/modules/auto-deploy.nix b/ops/modules/auto-deploy.nix
index a90300d42c68..83a8273562f6 100644
--- a/ops/modules/auto-deploy.nix
+++ b/ops/modules/auto-deploy.nix
@@ -1,5 +1,9 @@
 # Defines a service for automatically and periodically calling depot's
 # rebuild-system on a NixOS machine.
+#
+# Deploys can be stopped in emergency situations by creating an empty
+# file called `stop` in the state directory of the auto-deploy service
+# (typically /var/lib/auto-deploy).
 { depot, config, lib, pkgs, ... }:
 
 let
@@ -15,6 +19,11 @@ let
       exit 1
     fi
 
+    if [[ -f $STATE_DIRECTORY/stop ]]; then
+      echo "stop file exists in $STATE_DIRECTORY, not deploying!" >&2
+      exit 1
+    fi
+
     readonly depot=$STATE_DIRECTORY/depot.git
     readonly deploy=$STATE_DIRECTORY/deploy
     readonly git="git -C $depot"