mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
60 lines
1.4 KiB
Nix
60 lines
1.4 KiB
Nix
{ config
|
|
, lib
|
|
, pkgs
|
|
, ...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.coolercontrol;
|
|
in
|
|
{
|
|
##### interface
|
|
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.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
##### implementation
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
# Common
|
|
({
|
|
environment.systemPackages = with pkgs.coolercontrol; [
|
|
coolercontrol-gui
|
|
];
|
|
|
|
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 ];
|
|
}
|