From b2edfe64b9170184191dd919c83c5ce433acbb27 Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Thu, 16 May 2024 16:58:17 +0200
Subject: [PATCH] Allow passing custom arguments to `rclone mount`

---
 lib/modules/rclone.nix | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/modules/rclone.nix b/lib/modules/rclone.nix
index 683d613..574079d 100644
--- a/lib/modules/rclone.nix
+++ b/lib/modules/rclone.nix
@@ -89,11 +89,23 @@ let
           default = "";
         };
 
+        extraArgs = lib.mkOption {
+          type = lib.types.listOf lib.types.str;
+          description = "A set of additional arguments to pass to `rclone mount`.";
+          default = [];
+        };
+
         config = lib.mkOption {
           type = lib.types.attrs;
           description = "The rclone config to use for creating the mount.";
           visible = false;
         };
+
+        args = lib.mkOption {
+          type = lib.types.listOf lib.types.str;
+          description = "The arguments to pass to `rclone mount`.";
+          visible = false;
+        };
       };
 
       config = {
@@ -102,6 +114,8 @@ let
             builtins.mapAttrs
               (name: path: "export ${name}=\"$(cat ${lib.escapeShellArg path})\"")
               config.secrets));
+
+        args = config.extraArgs;
       };
     });