Patching NixOS config

Hi, I am trying to add --ignore-default-control to thermald service:

[Service]
Type=dbus
SuccessExitStatus=1
BusName=org.freedesktop.thermald
ExecStart=/nix/store/sahg7c0lxzw28i3b6yz02024nwmnrdv0-thermald-2.2/sbin/thermald --no-daemon --dbus-enable

I looked at the source, and there is currently no way to do that. So my question is how can I patch it?

Sorry for the noobie question, I will be grateful for the correct keyword to google.
Stuff like “nixos patch XY” or “nix change nix expression” was not helpful.

You can override systemd service lines using systemd.services.<name>.serviceConfig:

Do not forget about the empty string, otherwise systemd will append your value to ExecStart instead of overriding it.

1 Like