Nixos-rebuild error in services.picom.activeOpacity

When trying to rebuild with my config I get this error now

error: The option value `services.picom.activeOpacity' in `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/services/x11/picom.nix' is not of type `a floating point number in range [0, 1]'.

It seems that the services.picom module was recently changed (refactoring strings to floats), but I’m not sure why this is giving me an issue. I’m using the nixos-unstable branch as my nixos branch.

Solution: Change the value of services.picom.activeOpacity from a string to a float in configuration.nix. Forgot that services.compton is just an alias for services.picom.

Hi, I made this change. As you said, the solution is to remove the quotes around the number. I could have added code to keep compatibility with the previous type (string) but I didn’t know how to warn users about this so I just went this way.

In any case the change is documented in the (upcoming) release notes for NixOS 20.09. If you are on unstable I don’t know of an easy way to read them, without updating the system first.

I hit this error when switching to nixos-unstable. Unfortunately none of my nix expressions use the picom service directly.


mous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:293:51, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:125:62:
while evaluating the attribute 'inactive-opacity' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:344:7:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:293:86, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:344:15:
while evaluating the attribute 'optionalValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:427:5:
while evaluating the attribute 'values' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:409:9:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:405:19, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:405:14:
while evaluating the attribute 'value._type' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:506:73:
while evaluating the attribute 'value.content' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:567:14:
while evaluating the attribute 'inactiveOpacity' at undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:84:45, called from undefined position:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:383:9:
while evaluating the option `services.picom.inactiveOpacity':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:415:5:
The option value `services.picom.inactiveOpacity' in `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/services/x11/picom.nix' is not of type `a floating point number in range [0.1, 1]'.

Ah, turns out compton is an alias for picom, and I had services.compton.inactiveOpacity in my configuration.