From 5df0574f41017e67462fcc7809fd117f2f7944be Mon Sep 17 00:00:00 2001
From: Bruno BELANYI <bruno@belanyi.fr>
Date: Thu, 21 Mar 2024 20:30:25 +0100
Subject: [PATCH] nixos: services: podgrab: add 'dataDir'

---
 modules/nixos/services/podgrab/default.nix | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/nixos/services/podgrab/default.nix b/modules/nixos/services/podgrab/default.nix
index f1a8eb2..ea89e4e 100644
--- a/modules/nixos/services/podgrab/default.nix
+++ b/modules/nixos/services/podgrab/default.nix
@@ -17,6 +17,15 @@ in
       '';
     };
 
+    dataDir = mkOption {
+      type = with types; nullOr str;
+      default = null;
+      example = "/mnt/podgrab";
+      description = ''
+        Path to the directory to store the podcasts. Use default if null
+      '';
+    };
+
     port = mkOption {
       type = types.port;
       default = 8080;
@@ -31,6 +40,7 @@ in
       inherit (cfg) passwordFile port;
 
       group = "media";
+      dataDirectory = lib.mkIf (cfg.dataDir != null) cfg.dataDir;
     };
 
     # Set-up media group