Hello! Yesterday I installed the latest NixOS on my computer. I have a somewhat old (not legacy) Nvidia GPU, and a somewhat old monitor that does not support the full color range. So, in order for my desktop to not look like a mess, I need to set the color range to limited in my nvidia-settings.
I installed the nvidia graphics by simply copy-pasting the sample from the wiki into my config. The problem is, nvidia-settings needs to be started every time I start a new session. I tried to make a user systemd unit to make it autostart the thing at login, like so:
systemd.user.services.nvidia-apply-settings = {
wantedBy = [ "default.target" ];
description = "Apply the nvidia-settings.";
serviceConfig = {
Type = "oneshot";
ExecStart = ''${something}/bin/nvidia-settings --load-config-only'';
};
};
The problem is, I can’t seem to figure out where to find the executable. The only way I managed to find the path to the package is in the nix repl using this monstrosity:
nix-repl> c = pkgs.nixos /etc/nixos/configuration.nix
nix-repl> "${(builtins.head (builtins.filter (x: !builtins.isNull (builtins.match "nvidia-settings.+" x.name)) c.config.environment.systemPackages))}"
But, well, it don’t work in configuration.nix and I am pretty sure this is not how I am supposed to do this anyways.