mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-31 14:41:27 +00:00
Merge pull request #78419 from utsl42/fix-unifi-install
nixos/unifi: use systemd tmpfiles instead of preStart
This commit is contained in:
commit
7adffb14cd
@ -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