diff --git a/modules/programs/rclone.nix b/modules/programs/rclone.nix index 9e92609bb..40fd5790f 100644 --- a/modules/programs/rclone.nix +++ b/modules/programs/rclone.nix @@ -111,6 +111,23 @@ in options = { enable = lib.mkEnableOption "this mount"; + logLevel = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "ERROR" + "NOTICE" + "INFO" + "DEBUG" + ] + ); + default = null; + example = "INFO"; + description = '' + Set the log-level. + See: https://rclone.org/docs/#logging + ''; + }; + mountPoint = lib.mkOption { type = lib.types.str; default = null; @@ -348,12 +365,13 @@ in Environment = [ # fusermount/fusermount3 "PATH=/run/wrappers/bin" - ]; + ] + ++ lib.optional (mount.logLevel != null) "RCLONE_LOG_LEVEL=${mount.logLevel}"; + ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${mount.mountPoint}"; ExecStart = lib.concatStringsSep " " [ (lib.getExe cfg.package) "mount" - "-vv" (lib.cli.toGNUCommandLineShell { } mount.options) "${remote-name}:${mount-path}" "${mount.mountPoint}"