summary refs log tree commit diff
path: root/nixos/modules/services/networking/openconnect.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/networking/openconnect.nix')
-rw-r--r--nixos/modules/services/networking/openconnect.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/openconnect.nix b/nixos/modules/services/networking/openconnect.nix
index de4b505130e..bc873b2198b 100644
--- a/nixos/modules/services/networking/openconnect.nix
+++ b/nixos/modules/services/networking/openconnect.nix
@@ -9,6 +9,12 @@ let
   };
   interfaceOptions = {
     options = {
+      autoStart = mkOption {
+        default = true;
+        description = "Whether this VPN connection should be started automatically.";
+        type = types.bool;
+      };
+
       gateway = mkOption {
         description = "Gateway server to connect to.";
         example = "gateway.example.com";
@@ -95,7 +101,7 @@ let
     description = "OpenConnect Interface - ${name}";
     requires = [ "network-online.target" ];
     after = [ "network.target" "network-online.target" ];
-    wantedBy = [ "multi-user.target" ];
+    wantedBy = optional icfg.autoStart "multi-user.target";
 
     serviceConfig = {
       Type = "simple";