2023-10-06 18:05:38 +02:00
|
|
|
{ config, ... }: let
|
2023-07-12 02:00:06 +02:00
|
|
|
cfg = config.services.plex;
|
|
|
|
in {
|
2022-03-07 16:01:52 +01:00
|
|
|
services.plex = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
|
2023-07-12 02:00:06 +02:00
|
|
|
systemd.services.plex.serviceConfig = {
|
|
|
|
ReadWritePaths = [ cfg.dataDir ];
|
|
|
|
NoNewPrivileges = true;
|
|
|
|
PrivateDevices = true;
|
|
|
|
ProtectClock = true;
|
|
|
|
ProtectKernelLogs = true;
|
|
|
|
ProtectKernelModules = true;
|
|
|
|
PrivateMounts = true;
|
|
|
|
RestrictSUIDSGID = true;
|
|
|
|
ProtectHostname = true;
|
|
|
|
LockPersonality = true;
|
|
|
|
ProtectKernelTunables = true;
|
|
|
|
ProtectSystem = "strict";
|
|
|
|
ProtectProc = true;
|
|
|
|
ProtectHome = true;
|
|
|
|
# PrivateNetwork = true;
|
|
|
|
PrivateUsers = true;
|
|
|
|
PrivateTmp = true;
|
|
|
|
UMask = "0007";
|
|
|
|
# RestrictAddressFamilies = [ "AF_UNIX AF_INET AF_INET6" ];
|
|
|
|
SystemCallArchitectures = "native";
|
|
|
|
};
|
2022-03-07 16:01:52 +01:00
|
|
|
}
|