1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2025-05-20 11:30:53 +02:00
parent e7cb8ff3f2
commit 9240071d92
No known key found for this signature in database

View file

@ -33,7 +33,7 @@ in
};
cacheDir = lib.mkOption {
default = "cache";
default = "filebrowser";
description = ''
The directory below `/var/cache` where FileBrowser stores its cache.
'';
@ -48,6 +48,7 @@ in
'';
type = types.submodule {
freeformType = format.type;
options = {
address = lib.mkOption {
default = "localhost";
@ -135,16 +136,21 @@ in
};
script = ''
mkdir --parents -- ${lib.escapeShellArgs [
cfg.settings.root
(builtins.dirOf cfg.settings.database)
]}
cd -- ${lib.escapeShellArg cfg.settings.root}
exec ${lib.getExe cfg.package} --config ${format.generate "config.json" cfg.settings}
'';
};
tmpfiles.settings.filebrowser =
lib.genAttrs
[
cfg.settings.root
(builtins.dirOf cfg.settings.database)
]
(_: {
d.mode = "0700";
});
};
networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewall [ cfg.settings.port ];