44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ lib, config, ... }:
|
|
{
|
|
config.systemd.services = lib.mkIf (config.specialisation != { }) {
|
|
acpid.serviceConfig = {
|
|
CapabilityBoundingSet = [
|
|
""
|
|
];
|
|
NoNewPrivileges = true;
|
|
RestrictNamespaces = [
|
|
"~pid"
|
|
"~user"
|
|
"~net"
|
|
"~uts"
|
|
"~mnt"
|
|
"~cgroup"
|
|
"~ipc"
|
|
];
|
|
|
|
ProtectControlGroups = true;
|
|
ProtectKernelModules = true;
|
|
ProtectKernelTunables = true;
|
|
MemoryDenyWriteExecute = true;
|
|
RestrictSUIDSGID = true;
|
|
SystemCallArchitectures = "native";
|
|
SystemCallFilter = "@system-service";
|
|
LockPersonality = true;
|
|
ProtectSystem = "strict";
|
|
PrivateUsers = true;
|
|
RestrictRealtime = true;
|
|
PrivateTmp = true;
|
|
ProtectHome = true;
|
|
ProtectProc = "invisible";
|
|
ProtectKernelLogs = true;
|
|
IPAddressAllow = [ ];
|
|
|
|
PrivateDevices = false; # acpi obviously needs device access
|
|
PrivateNetwork = false; # required for netlink to work properly
|
|
RestrictAddressFamilies = [
|
|
"AF_NETLINK"
|
|
"AF_UNIX"
|
|
];
|
|
};
|
|
};
|
|
}
|