Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coolercontrol.*: 1.1.1 -> 1.2.2 #300711

Merged
merged 3 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 deletions nixos/modules/programs/coolercontrol.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,50 @@ in
{
##### interface
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
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs.coolercontrol; [
coolercontrol-gui
];

systemd = {
packages = with pkgs.coolercontrol; [
coolercontrol-liqctld
coolercontrold
config = lib.mkIf cfg.enable (lib.mkMerge [
# Common
({
environment.systemPackages = with pkgs.coolercontrol; [
coolercontrol-gui
];

# https://github.com/NixOS/nixpkgs/issues/81138
services = {
coolercontrol-liqctld.wantedBy = [ "multi-user.target" ];
coolercontrold.wantedBy = [ "multi-user.target" ];
systemd = {
packages = with pkgs.coolercontrol; [
coolercontrol-liqctld
coolercontrold
];

# https://github.com/NixOS/nixpkgs/issues/81138
services = {
coolercontrol-liqctld.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 ];
}
Loading