nixos/coolercontrol: Add support for Nvidia hardware
This commit is contained in:
@@ -10,11 +10,24 @@ in
|
|||||||
{
|
{
|
||||||
##### interface
|
##### interface
|
||||||
options = {
|
options = {
|
||||||
programs.coolercontrol.enable = lib.mkEnableOption (lib.mdDoc "CoolerControl GUI & its background services");
|
programs.coolercontrol = {
|
||||||
|
enable = lib.mkEnableOption (lib.mdDoc "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 = lib.mdDoc ''
|
||||||
|
Enable support for Nvidia GPUs.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
##### implementation
|
##### implementation
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
|
# Common
|
||||||
|
({
|
||||||
environment.systemPackages = with pkgs.coolercontrol; [
|
environment.systemPackages = with pkgs.coolercontrol; [
|
||||||
coolercontrol-gui
|
coolercontrol-gui
|
||||||
];
|
];
|
||||||
@@ -31,7 +44,16 @@ in
|
|||||||
coolercontrold.wantedBy = [ "multi-user.target" ];
|
coolercontrold.wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
})
|
||||||
|
|
||||||
|
# Nvidia support
|
||||||
|
(lib.mkIf cfg.nvidiaSupport {
|
||||||
|
systemd.services.coolercontrold.path = with config.boot.kernelPackages; [
|
||||||
|
nvidia_x11 # nvidia-smi
|
||||||
|
nvidia_x11.settings # nvidia-settings
|
||||||
|
];
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
|
||||||
meta.maintainers = with lib.maintainers; [ OPNA2608 codifryed ];
|
meta.maintainers = with lib.maintainers; [ OPNA2608 codifryed ];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user