From 25ee658d02ce92355cc3f1e0f102656dca6b6394 Mon Sep 17 00:00:00 2001 From: Lukas Wurzinger Date: Mon, 19 May 2025 17:58:10 +0200 Subject: [PATCH] stuff --- modules/filebrowser.nix | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/filebrowser.nix b/modules/filebrowser.nix index 7779ec8..ff9783f 100644 --- a/modules/filebrowser.nix +++ b/modules/filebrowser.nix @@ -43,13 +43,10 @@ in type = types.bool; }; - storage = lib.mkOption { - default = "${cfg.settings.root}/data"; - defaultText = lib.literalExpression '' - "''${config.services.filebrowser.settings.root}/data" - ''; + stateDir = lib.mkOption { + default = "/var/lib/filebrowser"; description = '' - The directory where FileBrowser stores files. + The directory where FileBrowser stores its state. ''; type = types.path; }; @@ -80,26 +77,32 @@ in }; root = lib.mkOption { - default = "/var/lib/filebrowser"; + default = "${cfg.stateDir}/data"; + defaultText = lib.literalExpression '' + "''${config.services.filebrowser.stateDir}/data" + ''; description = '' - The directory where FileBrowser stores its state. + The directory where FileBrowser stores files. ''; type = types.path; }; database = lib.mkOption { - default = "${cfg.settings.root}/database.db"; + default = "/var/lib//database.db"; defaultText = lib.literalExpression '' - "''${config.services.filebrowser.settings.root}/database.db" + "''${config.services.filebrowser.stateDir}/database.db" ''; description = '' - The path to FileBrowser's database. + The path to FileBrowser's Bolt database. ''; type = types.path; }; cache-dir = lib.mkOption { - default = null; + default = "${cfg.stateDir}/cache"; + defaultText = lib.literalExpression '' + "''${config.services.filebrowser.stateDir}/cache" + ''; description = '' The directory where FileBrowser stores its cache. ''; @@ -128,8 +131,8 @@ in in utils.escapeSystemdExecArgs args; - StateDirectory = cfg.settings.root; - WorkingDirectory = cfg.storage; + StateDirectory = cfg.stateDir; + WorkingDirectory = cfg.settings.root; User = cfg.user; Group = cfg.group;