nixos/unifi: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
This commit is contained in:
parent
4a4d3a2e04
commit
0b7305e783
@ -146,6 +146,11 @@ in
|
|||||||
where = where;
|
where = where;
|
||||||
}) mountPoints;
|
}) mountPoints;
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"e '${stateDir}' 0700 unifi - - -"
|
||||||
|
"e '${stateDir}/data' 0700 unifi - - -"
|
||||||
|
];
|
||||||
|
|
||||||
systemd.services.unifi = {
|
systemd.services.unifi = {
|
||||||
description = "UniFi controller daemon";
|
description = "UniFi controller daemon";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
@ -157,14 +162,9 @@ in
|
|||||||
environment.LD_LIBRARY_PATH = with pkgs.stdenv; "${cc.cc.lib}/lib";
|
environment.LD_LIBRARY_PATH = with pkgs.stdenv; "${cc.cc.lib}/lib";
|
||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
# Ensure privacy of state and data.
|
|
||||||
chown unifi "${stateDir}" "${stateDir}/data"
|
|
||||||
chmod 0700 "${stateDir}" "${stateDir}/data"
|
|
||||||
|
|
||||||
# Create the volatile webapps
|
# Create the volatile webapps
|
||||||
rm -rf "${stateDir}/webapps"
|
rm -rf "${stateDir}/webapps"
|
||||||
mkdir -p "${stateDir}/webapps"
|
mkdir -p "${stateDir}/webapps"
|
||||||
chown unifi "${stateDir}/webapps"
|
|
||||||
ln -s "${cfg.unifiPackage}/webapps/ROOT" "${stateDir}/webapps/ROOT"
|
ln -s "${cfg.unifiPackage}/webapps/ROOT" "${stateDir}/webapps/ROOT"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -177,7 +177,6 @@ in
|
|||||||
ExecStart = "${(removeSuffix "\n" cmd)} start";
|
ExecStart = "${(removeSuffix "\n" cmd)} start";
|
||||||
ExecStop = "${(removeSuffix "\n" cmd)} stop";
|
ExecStop = "${(removeSuffix "\n" cmd)} stop";
|
||||||
User = "unifi";
|
User = "unifi";
|
||||||
PermissionsStartOnly = true;
|
|
||||||
UMask = "0077";
|
UMask = "0077";
|
||||||
WorkingDirectory = "${stateDir}";
|
WorkingDirectory = "${stateDir}";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user