Add fancontrol #16
4 changed files with 41 additions and 0 deletions
|
|
@ -32,6 +32,9 @@
|
||||||
|
|
||||||
zen-browser.url = "github:youwen5/zen-browser-flake";
|
zen-browser.url = "github:youwen5/zen-browser-flake";
|
||||||
|
|
||||||
|
# TODO move to upstream repository after merged nix flake pr
|
||||||
|
fancontrol.url = "git+https://github.com/DashieTM/fancontrol-gui?ref=nix-flake";
|
||||||
|
|
||||||
stylix.url = "github:danth/stylix";
|
stylix.url = "github:danth/stylix";
|
||||||
base16.url = "github:SenchoPens/base16.nix";
|
base16.url = "github:SenchoPens/base16.nix";
|
||||||
disko.url = "github:nix-community/disko/latest";
|
disko.url = "github:nix-community/disko/latest";
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@
|
||||||
inputs.reset.homeManagerModules.default
|
inputs.reset.homeManagerModules.default
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
inputs.dashvim.homeManagerModules.dashvim
|
inputs.dashvim.homeManagerModules.dashvim
|
||||||
|
inputs.fancontrol.homeManagerModules.default
|
||||||
../modules
|
../modules
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
./coding.nix
|
./coding.nix
|
||||||
./containers.nix
|
./containers.nix
|
||||||
./drives.nix
|
./drives.nix
|
||||||
|
./fancontrol.nix
|
||||||
./fastfetch.nix
|
./fastfetch.nix
|
||||||
./fish.nix
|
./fish.nix
|
||||||
./flatpak.nix
|
./flatpak.nix
|
||||||
|
|
|
||||||
36
modules/programs/fancontrol.nix
Normal file
36
modules/programs/fancontrol.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options.mods.fancontrol = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "Enables fancontrol-gui with needed drivers";
|
||||||
|
};
|
||||||
|
forceId = lib.mkOption {
|
||||||
|
default = null;
|
||||||
|
example = "force_id=0x8628";
|
||||||
|
type = with lib.types; nullOr str;
|
||||||
|
description = "Modprobe options for the it87 driver. Information at: https://wiki.archlinux.org/title/Lm_sensors#Gigabyte_B250/Z370/B450M/B560M/B660M/Z690/B550_motherboards";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf config.mods.fancontrol.enable (
|
||||||
|
lib.optionalAttrs (options ? home.packages) {
|
||||||
|
programs.fancontrol-gui.enable = true;
|
||||||
|
}
|
||||||
|
// (lib.optionalAttrs (options ? boot.kernelModules) {
|
||||||
|
boot = {
|
||||||
|
kernelParams = ["acpi_enforce_resources=lax"];
|
||||||
|
extraModulePackages = with config.boot.kernelPackages; [liquidtux it87];
|
||||||
|
kernelModules = ["v4l2loopback" "it87"];
|
||||||
|
extraModprobeConfig = lib.mkIf (config.mods.fancontrol.forceId != null) ''
|
||||||
|
options it87 ${config.mods.fancontrol.forceId}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue