{ lib, config, ... }: let inherit (lib) mkDefault types mkIf; in { options.systemd.services = lib.mkOption { type = let osConfig = config; in types.attrsOf ( lib.types.submodule { config.serviceConfig = mkIf (osConfig.specialisation != { }) { RestrictRealtime = mkDefault true; }; } ); }; config = mkIf (config.specialisation != { }) { systemd.services = { rtkit-daemon.serviceConfig.RestrictRealtime = false; }; }; }