From 106bfcaf8a916650f01df5498020e273905c2172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 27 May 2022 17:17:16 +0200 Subject: [PATCH] nixos/openconnect: add autoStart option --- nixos/modules/services/networking/openconnect.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/openconnect.nix b/nixos/modules/services/networking/openconnect.nix index de4b505130eb..bc873b2198bc 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";