2024-11-18 14:26:43 +01:00
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.printing;
|
|
|
|
in
|
2024-08-12 17:36:13 +02:00
|
|
|
{
|
2024-11-18 14:26:43 +01:00
|
|
|
# services.printing.enable = !config.machineVars.headless;
|
|
|
|
services.printing.enable = false;
|
|
|
|
|
|
|
|
systemd.services = lib.mkIf cfg.enable {
|
|
|
|
cups.serviceConfig = {
|
|
|
|
PrivateTmp = true;
|
|
|
|
ProtectSystem = "strict";
|
|
|
|
ProtectHome = true;
|
|
|
|
ProtectClock= true;
|
|
|
|
ProtectControlGroups = true;
|
|
|
|
ProtectHostname = true;
|
|
|
|
ProtectKernelLogs = true;
|
|
|
|
ProtectKernelModules = true;
|
|
|
|
ProtectKernelTunables = true;
|
|
|
|
ProtectProc = "invisible";
|
|
|
|
PrivateDevices = true;
|
|
|
|
NoNewPrivileges = true;
|
|
|
|
# User =
|
|
|
|
AmbientCapabilities = [ "" ];
|
|
|
|
CapabilityBoundingSet = [ "" ];
|
|
|
|
DevicePolicy = "closed";
|
|
|
|
KeyringMode = "private";
|
|
|
|
LockPersonality = true;
|
|
|
|
MemoryDenyWriteExecute = true;
|
|
|
|
PrivateUsers = true;
|
|
|
|
RemoveIPC = true;
|
|
|
|
# RestrictAddressFamilies = [ "" ];
|
|
|
|
RestrictNamespaces=true;
|
|
|
|
RestrictRealtime=true;
|
|
|
|
RestrictSUIDSGID=true;
|
|
|
|
SystemCallArchitectures = "native";
|
|
|
|
SystemCallFilter = [
|
|
|
|
"@system-service"
|
|
|
|
"~@privileged"
|
|
|
|
];
|
|
|
|
UMask = "0077";
|
|
|
|
};
|
|
|
|
cups-browsed.serviceConfig = lib.mkIf cfg.enable {
|
|
|
|
PrivateTmp = true;
|
|
|
|
ProtectSystem = "strict";
|
|
|
|
ProtectHome = true;
|
|
|
|
ProtectClock= true;
|
|
|
|
ProtectControlGroups = true;
|
|
|
|
ProtectHostname = true;
|
|
|
|
ProtectKernelLogs = true;
|
|
|
|
ProtectKernelModules = true;
|
|
|
|
ProtectKernelTunables = true;
|
|
|
|
ProtectProc = "invisible";
|
|
|
|
PrivateDevices = true;
|
|
|
|
NoNewPrivileges = true;
|
|
|
|
# User =
|
|
|
|
AmbientCapabilities = [ "" ];
|
|
|
|
CapabilityBoundingSet = [ "" ];
|
|
|
|
DevicePolicy = "closed";
|
|
|
|
KeyringMode = "private";
|
|
|
|
LockPersonality = true;
|
|
|
|
MemoryDenyWriteExecute = true;
|
|
|
|
PrivateUsers = true;
|
|
|
|
RemoveIPC = true;
|
|
|
|
# RestrictAddressFamilies = [ "" ];
|
|
|
|
RestrictNamespaces=true;
|
|
|
|
RestrictRealtime=true;
|
|
|
|
RestrictSUIDSGID=true;
|
|
|
|
SystemCallArchitectures = "native";
|
|
|
|
SystemCallFilter = [
|
|
|
|
"@system-service"
|
|
|
|
"~@privileged"
|
|
|
|
];
|
|
|
|
UMask = "0077";
|
|
|
|
};
|
|
|
|
};
|
2024-08-12 17:36:13 +02:00
|
|
|
}
|