{ lib, pkgs, ... }: let inherit (lib.meta) getExe; in { systemd.user.services.wayneko = { description = "Wayneko, as a systemd service"; # makes the graphical session start this service when it starts wantedBy = ["graphical-session.target"]; # when graphical session restarts or gets stopped, this also gets restarted/stopped. partOf = ["graphical-session.target"]; # gets started only after graphical session after = ["graphical-session.target"]; serviceConfig = { ExecStart = "${getExe pkgs.wayneko} --layer top --follow-pointer false"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; CapabilityBoundingSet = [""]; DevicePolicy = "closed"; LockPersonality = true; MemoryDenyWriteExecute = true; NoNewPrivileges = true; PrivateDevices = true; PrivateNetwork = true; PrivateTmp = true; PrivateUsers = true; ProcSubset = "pid"; ProtectClock = true; ProtectControlGroups = true; ProtectControlGroup = true; ProtectHome = "true"; ProtectHostname = true; ProtectKernelLogs = true; ProtectKernelModules = true; ProtectKernelTunables = true; ProtectProc = "invisible"; ProtectSystem = "strict"; RestrictNamespaces = true; RestrictRealtime = true; RestrictRealTime = true; RestrictSUIDSGID = true; SystemCallArchitectures = ["native"]; SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ]; }; }; }