mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-19 07:59:24 +03:00

After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
80 lines
2.1 KiB
Nix
80 lines
2.1 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.programs.tuxclocker;
|
|
in
|
|
{
|
|
options.programs.tuxclocker = {
|
|
enable = lib.mkEnableOption ''
|
|
TuxClocker, a hardware control and monitoring program
|
|
'';
|
|
|
|
enableAMD = lib.mkEnableOption ''
|
|
AMD GPU controls.
|
|
Sets the `amdgpu.ppfeaturemask` kernel parameter to 0xfffd7fff to enable all TuxClocker controls
|
|
'';
|
|
|
|
enabledNVIDIADevices = lib.mkOption {
|
|
type = lib.types.listOf lib.types.int;
|
|
default = [ ];
|
|
example = [
|
|
0
|
|
1
|
|
];
|
|
description = ''
|
|
Enable NVIDIA GPU controls for a device by index.
|
|
Sets the `Coolbits` Xorg option to enable all TuxClocker controls.
|
|
'';
|
|
};
|
|
|
|
useUnfree = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
example = true;
|
|
description = ''
|
|
Whether to use components requiring unfree dependencies.
|
|
Disabling this allows you to get everything from the binary cache.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config =
|
|
let
|
|
package = if cfg.useUnfree then pkgs.tuxclocker else pkgs.tuxclocker-without-unfree;
|
|
in
|
|
lib.mkIf cfg.enable {
|
|
environment.systemPackages = [
|
|
package
|
|
];
|
|
|
|
services.dbus.packages = [
|
|
package
|
|
];
|
|
|
|
# MSR is used for some features
|
|
boot.kernelModules = [ "msr" ];
|
|
|
|
# https://download.nvidia.com/XFree86/Linux-x86_64/430.14/README/xconfigoptions.html#Coolbits
|
|
services.xserver.config =
|
|
let
|
|
configSection = (
|
|
i: ''
|
|
Section "Device"
|
|
Driver "nvidia"
|
|
Option "Coolbits" "31"
|
|
Identifier "Device-nvidia[${toString i}]"
|
|
EndSection
|
|
''
|
|
);
|
|
in
|
|
lib.concatStrings (map configSection cfg.enabledNVIDIADevices);
|
|
|
|
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/include/amd_shared.h#n207
|
|
# Enable everything modifiable in TuxClocker
|
|
boot.kernelParams = lib.mkIf cfg.enableAMD [ "amdgpu.ppfeaturemask=0xfffd7fff" ];
|
|
};
|
|
}
|