lol

Merge pull request #78419 from utsl42/fix-unifi-install

nixos/unifi: use systemd tmpfiles instead of preStart

authored by

Aaron Andersen and committed by
GitHub
7adffb14 b7c59cc7

+3 -12
+3 -12
nixos/modules/services/networking/unifi.nix
··· 147 147 }) mountPoints; 148 148 149 149 systemd.tmpfiles.rules = [ 150 - "e '${stateDir}' 0700 unifi - - -" 150 + "d '${stateDir}' 0700 unifi - - -" 151 151 "d '${stateDir}/data' 0700 unifi - - -" 152 + "d '${stateDir}/webapps' 0700 unifi - - -" 153 + "L+ '${stateDir}/webapps/ROOT' - - - - ${cfg.unifiPackage}/webapps/ROOT" 152 154 ]; 153 155 154 156 systemd.services.unifi = { ··· 160 162 unitConfig.RequiresMountsFor = stateDir; 161 163 # This a HACK to fix missing dependencies of dynamic libs extracted from jars 162 164 environment.LD_LIBRARY_PATH = with pkgs.stdenv; "${cc.cc.lib}/lib"; 163 - 164 - preStart = '' 165 - # Create the volatile webapps 166 - rm -rf "${stateDir}/webapps" 167 - mkdir -p "${stateDir}/webapps" 168 - ln -s "${cfg.unifiPackage}/webapps/ROOT" "${stateDir}/webapps/ROOT" 169 - ''; 170 - 171 - postStop = '' 172 - rm -rf "${stateDir}/webapps" 173 - ''; 174 165 175 166 serviceConfig = { 176 167 Type = "simple";