1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2025-05-26 13:27:17 +02:00
parent f7d79af95e
commit 0d4a7b2ec2
No known key found for this signature in database

View file

@ -25,22 +25,6 @@ in
type = types.bool; type = types.bool;
}; };
stateDir = lib.mkOption {
default = "filebrowser";
description = ''
The directory below `/var/lib` where FileBrowser stores its state.
'';
type = types.str;
};
cacheDir = lib.mkOption {
default = "filebrowser";
description = ''
The directory below `/var/cache` where FileBrowser stores its cache.
'';
type = types.nullOr types.str;
};
settings = lib.mkOption { settings = lib.mkOption {
default = { }; default = { };
description = '' description = ''
@ -68,10 +52,7 @@ in
}; };
root = lib.mkOption { root = lib.mkOption {
default = "/var/lib/${cfg.stateDir}/data"; default = "/var/lib/filebrowser/data";
defaultText = lib.literalExpression ''
"/var/lib/''${config.services.filebrowser.stateDir}/data"
'';
description = '' description = ''
The directory where FileBrowser stores files. The directory where FileBrowser stores files.
''; '';
@ -79,10 +60,7 @@ in
}; };
database = lib.mkOption { database = lib.mkOption {
default = "/var/lib/${cfg.stateDir}/database.db"; default = "/var/lib/filebrowser/database.db";
defaultText = lib.literalExpression ''
"/var/lib/''${config.services.filebrowser.stateDir}/database.db"
'';
description = '' description = ''
The path to FileBrowser's Bolt database. The path to FileBrowser's Bolt database.
''; '';
@ -90,11 +68,7 @@ in
}; };
cache-dir = lib.mkOption { cache-dir = lib.mkOption {
# default = if cfg.cacheDir != null then "/var/cache/${cfg.cacheDir}" else null; default = "/var/cache/filebrowser";
default = lib.mkIf (cfg.cacheDir != null) "/var/cache/${cfg.cacheDir}";
defaultText = lib.literalExpression ''
if config.services.filebrowser.cacheDir != null then "/var/cache/''${config.services.filebrowser.cacheDir}" else null
'';
description = '' description = ''
The directory where FileBrowser stores its cache. The directory where FileBrowser stores its cache.
''; '';
@ -124,8 +98,8 @@ in
in in
utils.escapeSystemdExecArgs args; utils.escapeSystemdExecArgs args;
StateDirectory = cfg.stateDir; StateDirectory = "filebrowser";
CacheDirectory = lib.mkIf (cfg.cacheDir != null) cfg.cacheDir; CacheDirectory = "filebrowser";
WorkingDirectory = cfg.settings.root; WorkingDirectory = cfg.settings.root;
DynamicUser = true; DynamicUser = true;