stuff
This commit is contained in:
parent
9240071d92
commit
4ccf968abd
1 changed files with 12 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
utils,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
@ -112,8 +113,19 @@ in
|
||||||
description = "FileBrowser";
|
description = "FileBrowser";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
ExecStart =
|
||||||
|
let
|
||||||
|
args = [
|
||||||
|
(lib.getExe cfg.package)
|
||||||
|
"--config"
|
||||||
|
(format.generate "config.json" cfg.settings)
|
||||||
|
];
|
||||||
|
in
|
||||||
|
utils.escapeSystemdExecArgs args;
|
||||||
|
|
||||||
StateDirectory = cfg.stateDir;
|
StateDirectory = cfg.stateDir;
|
||||||
CacheDirectory = lib.mkIf (cfg.cacheDir != null) cfg.cacheDir;
|
CacheDirectory = lib.mkIf (cfg.cacheDir != null) cfg.cacheDir;
|
||||||
|
WorkingDirectory = cfg.settings.root;
|
||||||
|
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
|
|
||||||
|
@ -134,12 +146,6 @@ in
|
||||||
RestrictRealtime = true;
|
RestrictRealtime = true;
|
||||||
RestrictSUIDSGID = true;
|
RestrictSUIDSGID = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
script = ''
|
|
||||||
cd -- ${lib.escapeShellArg cfg.settings.root}
|
|
||||||
|
|
||||||
exec ${lib.getExe cfg.package} --config ${format.generate "config.json" cfg.settings}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tmpfiles.settings.filebrowser =
|
tmpfiles.settings.filebrowser =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue