nixpkgs/nixos/modules/programs/coolercontrol.nix
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
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.
2024-04-13 10:07:35 -07:00

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 ];
}