In order to fix some monitor brightness control related misbehavior I encountered after switching to Plasma 6, I am trying to apply the advice I got here. I have tried setting
systemd.user.services.plasma-powerdevil = {
environment = {
POWERDEVIL_NO_DDCUTIL = "1";
};
};
in the hopes of just being able to extend a nix-defined systemd service, but that does not seem to be the way this service comes into existence and I just get
❯ systemctl --user status plasma-powerdevil
● plasma-powerdevil.service
Loaded: bad-setting (Reason: Unit plasma-powerdevil.service has a bad unit file setting.)
Active: active (running) since Sat 2025-06-14 11:07:39 CEST; 11min ago
Invocation: 928c970dfeaf4e23a4d022b1d71e3675
Main PID: 2823 (.org_kde_powerd)
Tasks: 7 (limit: 37976)
Memory: 13.5M (peak: 14.2M)
CPU: 172ms
CGroup: /user.slice/user-1000.slice/user@1000.service/background.slice/plasma-powerdevil.service
└─2823 /nix/store/003sp6c3v67lplbr443qzfwngcpbjs16-powerdevil-6.3.5/libexec/org_kde_powerdevil
Jun 14 11:07:38 m-work systemd[2577]: Starting Powerdevil...
Jun 14 11:07:38 m-work org_kde_powerdevil[2823]: Starting libddcutil. library built Feb 17 2025 at 09:09:46. stdout_stderr_redirected=true
Jun 14 11:07:38 m-work org_kde_powerdevil[2823]: Initializing libddcutil. ddcutil version: 2.2.0-dev, shared library: /nix/store/7ywk1r5az73cyk8>
Jun 14 11:07:38 m-work org_kde_powerdevil[2823]: [ 2823] Options passed from client:
Jun 14 11:07:38 m-work org_kde_powerdevil[2823]: [ 2823] Applying combined libddcutil options:
Jun 14 11:07:38 m-work org_kde_powerdevil[2823]: Library initialization complete.
Jun 14 11:07:38 m-work org_kde_powerdevil[2823]: org.kde.powerdevil: [DDCutilDetector]: Failed to initialize callback
Jun 14 11:07:39 m-work systemd[2577]: Started Powerdevil.
Jun 14 11:07:39 m-work org_kde_powerdevil[2823]: org.kde.powerdevil: Handle button events action could not check for screen configuration
Jun 14 11:19:12 m-work systemd[2577]: plasma-powerdevil.service: Service has no ExecStart=, ExecStop=, or SuccessAction=. Refusing.
I will now attempt to just set the variable globally
environment.variables.POWERDEVIL_NO_DDCUTIL = "1";
but I do wonder if there is a better way?