From be4b09890e94e984824bb947ecd37a1516f27b1d Mon Sep 17 00:00:00 2001 From: ibizaman <ibizapeanut@gmail.com> Date: Wed, 7 Feb 2024 22:53:57 -0800 Subject: [PATCH] remove dependency of vpn.nix on sops-nix part of #24 --- modules/blocks/vpn.nix | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/modules/blocks/vpn.nix b/modules/blocks/vpn.nix index c0641a0..8e0ac92 100644 --- a/modules/blocks/vpn.nix +++ b/modules/blocks/vpn.nix @@ -232,7 +232,7 @@ in type = lib.types.str; }; - sopsFile = lib.mkOption { + authFile = lib.mkOption { description = "Location of file holding authentication secrets for provider."; type = lib.types.anything; }; @@ -264,8 +264,7 @@ in config = nordvpnConfig { inherit name; - inherit (c) dev remoteServerIP; - authFile = config.sops.secrets."${name}/auth".path; + inherit (c) dev remoteServerIP authFile; dependentServices = lib.optional (c.proxyPort != null) "tinyproxy-${name}.service"; }; }; @@ -273,18 +272,6 @@ in in lib.mkMerge (lib.mapAttrsToList instanceConfig cfg); - sops.secrets = - let - instanceConfig = name: c: lib.mkIf c.enable { - "${name}/auth" = { - sopsFile = c.sopsFile; - mode = "0440"; - restartUnits = [ "openvpn-${name}" ]; - }; - }; - in - lib.mkMerge (lib.mapAttrsToList instanceConfig cfg); - systemd.tmpfiles.rules = map (name: "d /tmp/openvpn/${name}.status 0700 root root" ) (lib.attrNames cfg);