Open l0b0 opened 5 months ago
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/how-to-enable-ddc-brightness-control-i2c-permissions/20800/22
You're supposed to use hardware.i2c.enable
. This gives local users access to all i2c devices, plus any other user in the i2c
group.
You're supposed to use
hardware.i2c.enable
. This gives local users access to all i2c devices, plus any other user in thei2c
group.
OK, then that's what programs.ddcutil.enable
should do. I was also told I had to add pkgs.ddcutil
to services.udev.packages
. The point is that neither of these are obvious, so they should be behind a simple switch.
With all these settings I'm still running into an issue, but that might be unrelated.
OK, then that's what programs.ddcutil.enable should do.
It doesn't justify an ad-hoc option, IMHO: ddcutil is not the only program that wants i2c access and it doesn't require any other particular setup.
The point is that neither of these are obvious, so they should be behind a simple switch.
I don't like the idea of options just for the sake of explaining other options: this is what the manual is for.
Note that as of ddcutil 2.0, installation generally takes care of ensuring that driver i2c-dev is loaded and that the logged on uses has read/write access to /dev/i2c devices associated with displays. See the release notes for version 2.0.0.
OK, then that's what programs.ddcutil.enable should do.
It doesn't justify an ad-hoc option, IMHO: ddcutil is not the only program that wants i2c access and it doesn't require any other particular setup.
Any program which requires i2c access should have such a switch, since it's not done as part of package install. But that's another issue.
The point is that neither of these are obvious, so they should be behind a simple switch.
I don't like the idea of options just for the sake of explaining other options: this is what the manual is for.
It's not for explaining anything, it's a convenience since discovering the need for i2c is non-obvious.
Note that as of ddcutil 2.0, installation generally takes care of ensuring that driver i2c-dev is loaded and that the logged on uses has read/write access to /dev/i2c devices associated with displays. See the release notes for version 2.0.0.
Is that actually going to be done by the nixpkgs install, though? If I understand correctly, @ElvishJerricco and @rnhmjoj think that installing this package should not load i2c. I agree, with an additional caveat: enabling programs.foo
should install programs.foo.package
and apply all the necessary side effects to get foo
working standalone, without any more manual work. Installing pkgs.foo
, on the other hand, should not have any side effects other than installing the package files in the Nix store. That way, foo's files can be used by other packages which don't depend on the extra side effects of programs.foo
.
Any program which requires i2c access should have such a switch, since it's not done as part of package install. But that's another issue.
By the same logic any game should have a programs.game.enable
that does hardware.opengl.enable = true
.
It's not for explaining anything, it's a convenience since discovering the need for i2c is non-obvious.
I think it's on the user to understand that this program requires the i2c module and devices permissions, it's also clearly stated in the project homepage. What may be non-obvious is that setting up i2c means hardware.i2c.enable
on NixOS, because it's not mentioned anywhere in the manual.
Note that as of ddcutil 2.0, installation generally takes care of ensuring that driver i2c-dev is loaded and that the logged on uses has read/write access to /dev/i2c devices associated with displays. See
I don't think this works on NixOS.
Issue description
There seems to be manual steps necessary to make
ddcutil
work. According to @ElvishJerricco this should be solved by having aprograms.ddcutil
option which does the necessary steps rather than changing system settings when installingpkgs.ddcutil
.I'm uncertain whether the package should set
services.udev.packages = [pkgs.ddcutil];
, the literal stringKERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
suggested by this post, or something else. I'm trying things out here.Steps to reproduce
pkgs.ddcutil
ddcutil detect
Technical details
"x86_64-linux"
Linux 6.1.79, NixOS, 24.05 (Uakari), 24.05pre588909.13aff9b34cc3
yes
yes
nix-env (Nix) 2.18.1
"nixos, nixos-hardware"
/nix/var/nix/profiles/per-user/root/channels/nixos