stuff
This commit is contained in:
parent
e7cb8ff3f2
commit
9240071d92
1 changed files with 12 additions and 6 deletions
|
@ -33,7 +33,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
cacheDir = lib.mkOption {
|
cacheDir = lib.mkOption {
|
||||||
default = "cache";
|
default = "filebrowser";
|
||||||
description = ''
|
description = ''
|
||||||
The directory below `/var/cache` where FileBrowser stores its cache.
|
The directory below `/var/cache` where FileBrowser stores its cache.
|
||||||
'';
|
'';
|
||||||
|
@ -48,6 +48,7 @@ in
|
||||||
'';
|
'';
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
freeformType = format.type;
|
freeformType = format.type;
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
address = lib.mkOption {
|
address = lib.mkOption {
|
||||||
default = "localhost";
|
default = "localhost";
|
||||||
|
@ -135,16 +136,21 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
mkdir --parents -- ${lib.escapeShellArgs [
|
|
||||||
cfg.settings.root
|
|
||||||
(builtins.dirOf cfg.settings.database)
|
|
||||||
]}
|
|
||||||
|
|
||||||
cd -- ${lib.escapeShellArg cfg.settings.root}
|
cd -- ${lib.escapeShellArg cfg.settings.root}
|
||||||
|
|
||||||
exec ${lib.getExe cfg.package} --config ${format.generate "config.json" cfg.settings}
|
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 ];
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewall [ cfg.settings.port ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue