mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-17 06:06:13 +03:00
nixos/unifi: use systemd tmpfiles instead of preStart
This commit is contained in:
parent
2a8ad18258
commit
b0208cb80f
@ -147,8 +147,10 @@ in
|
||||
}) mountPoints;
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"e '${stateDir}' 0700 unifi - - -"
|
||||
"d '${stateDir}' 0700 unifi - - -"
|
||||
"d '${stateDir}/data' 0700 unifi - - -"
|
||||
"d '${stateDir}/webapps' 0700 unifi - - -"
|
||||
"L+ '${stateDir}/webapps/ROOT' - - - - ${cfg.unifiPackage}/webapps/ROOT"
|
||||
];
|
||||
|
||||
systemd.services.unifi = {
|
||||
@ -161,17 +163,6 @@ in
|
||||
# This a HACK to fix missing dependencies of dynamic libs extracted from jars
|
||||
environment.LD_LIBRARY_PATH = with pkgs.stdenv; "${cc.cc.lib}/lib";
|
||||
|
||||
preStart = ''
|
||||
# Create the volatile webapps
|
||||
rm -rf "${stateDir}/webapps"
|
||||
mkdir -p "${stateDir}/webapps"
|
||||
ln -s "${cfg.unifiPackage}/webapps/ROOT" "${stateDir}/webapps/ROOT"
|
||||
'';
|
||||
|
||||
postStop = ''
|
||||
rm -rf "${stateDir}/webapps"
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${(removeSuffix "\n" cmd)} start";
|
||||
|
Loading…
Reference in New Issue
Block a user