nixos/kanata: notify systemd when starting up is finished

- set service type to notify
- allow unix socket which is needed by systemd notify
This commit is contained in:
Lin Jian 2023-02-16 20:59:43 +08:00 committed by pennae
parent a7717edb07
commit 4482c70530

View File

@ -86,6 +86,7 @@ let
mkService = name: keyboard: nameValuePair (mkName name) {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "notify";
ExecStart = ''
${getExe cfg.package} \
--cfg ${mkConfig name keyboard} \
@ -123,8 +124,7 @@ let
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
RestrictAddressFamilies =
if (keyboard.port == null) then "none" else [ "AF_INET" ];
RestrictAddressFamilies = [ "AF_UNIX" ] ++ optional (keyboard.port != null) "AF_INET";
RestrictNamespaces = true;
RestrictRealtime = true;
SystemCallArchitectures = [ "native" ];