nixos/coolercontrol: fix nvidia support
This commit is contained in:
@@ -13,18 +13,16 @@ in
|
||||
options = {
|
||||
programs.coolercontrol = {
|
||||
enable = lib.mkEnableOption "CoolerControl GUI & its background services";
|
||||
|
||||
nvidiaSupport = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = lib.elem "nvidia" config.services.xserver.videoDrivers;
|
||||
defaultText = lib.literalExpression "lib.elem \"nvidia\" config.services.xserver.videoDrivers";
|
||||
description = ''
|
||||
Enable support for Nvidia GPUs.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
# Added 2025-10-25
|
||||
(lib.mkRemovedOptionModule [ "programs" "coolercontrol" "nvidiaSupport" ] ''
|
||||
This option is deprecated as Nvidia drivers are automatically loaded at runtime.
|
||||
'')
|
||||
];
|
||||
|
||||
##### implementation
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
@@ -47,18 +45,6 @@ in
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
# Nvidia support
|
||||
(lib.mkIf cfg.nvidiaSupport {
|
||||
systemd.services.coolercontrold.path =
|
||||
let
|
||||
nvidiaPkg = config.hardware.nvidia.package;
|
||||
in
|
||||
[
|
||||
nvidiaPkg # nvidia-smi
|
||||
nvidiaPkg.settings # nvidia-settings
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
libdrm,
|
||||
coolercontrol,
|
||||
runtimeShell,
|
||||
addDriverRunpath,
|
||||
}:
|
||||
|
||||
{
|
||||
@@ -20,6 +21,7 @@ rustPlatform.buildRustPackage {
|
||||
cargoHash = "sha256-ZyYyQcaYd3VZ7FL0Hki33JO3LscPfBT5gl+nw2cXvUs=";
|
||||
|
||||
buildInputs = [ libdrm ];
|
||||
nativeBuildInputs = [ addDriverRunpath ];
|
||||
|
||||
postPatch = ''
|
||||
# copy the frontend static resources to a directory for embedding
|
||||
@@ -37,6 +39,10 @@ rustPlatform.buildRustPackage {
|
||||
--replace-fail '/usr/bin' "$out/bin"
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
addDriverRunpath "$out/bin/coolercontrold"
|
||||
'';
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = coolercontrol.coolercontrold;
|
||||
# coolercontrold prints its version with "v" prefix
|
||||
|
||||
Reference in New Issue
Block a user