From 270eefe14db14acce6ebc40ed9b6bd3eb26943a7 Mon Sep 17 00:00:00 2001
From: ibizaman <ibizapeanut@gmail.com>
Date: Wed, 7 Feb 2024 23:10:41 -0800
Subject: [PATCH] remove dependency of deluge.nix on sops-nix

part of #24
---
 modules/services/deluge.nix | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/modules/services/deluge.nix b/modules/services/deluge.nix
index 8dc314b..e13b3c2 100644
--- a/modules/services/deluge.nix
+++ b/modules/services/deluge.nix
@@ -154,10 +154,9 @@ in
       example = "https://authelia.example.com";
     };
 
-    sopsFile = lib.mkOption {
+    authFile = lib.mkOption {
       type = lib.types.path;
-      description = "Sops file location.";
-      example = "secrets/torrent.yaml";
+      description = "File containing auth lines in the format expected by deluge. See https://dev.deluge-torrent.org/wiki/UserGuide/Authentication.";
     };
 
     enabledPlugins = lib.mkOption {
@@ -230,7 +229,7 @@ in
 
         new_release_check = false;
       };
-      authFile = config.sops.secrets."deluge/auth".path;
+      inherit (cfg) authFile;
 
       web.enable = true;
       web.port = cfg.webPort;
@@ -254,14 +253,6 @@ in
           "L+ ${config.services.deluge.dataDir}/.config/deluge/plugins - - - - ${plugins}"
         ];
 
-    sops.secrets."deluge/auth" = {
-      inherit (cfg) sopsFile;
-      mode = "0440";
-      owner = config.services.deluge.user;
-      group = config.services.deluge.group;
-      restartUnits = [ "deluged.service" "delugeweb.service" ];
-    };
-
     shb.nginx.autheliaProtect = lib.mkIf config.shb.authelia.enable [
       {
         inherit (cfg) subdomain domain authEndpoint ssl;