feat(pstate): opt in changes and sooooo
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
variant = "latest";
|
||||
hardware = [ "amd" ];
|
||||
extraKernelParams = [ ];
|
||||
amdOverdrive.enable = true;
|
||||
};
|
||||
loader = {
|
||||
default = {
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
mkEnableOption
|
||||
mkIf
|
||||
;
|
||||
cfg = config.nixos.boot.kernel;
|
||||
|
||||
hasHardware = hw: builtins.elem hw cfg.hardware;
|
||||
@@ -37,8 +42,11 @@ in
|
||||
);
|
||||
default = [ ];
|
||||
description = "List of hardware types (e.g. GPU and CPU vendors) to configure kernel settings for.";
|
||||
|
||||
};
|
||||
|
||||
amdOverdrive.enable = mkEnableOption "Enable AMD pstate/overdrive";
|
||||
|
||||
extraKernelParams = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
@@ -74,7 +82,7 @@ in
|
||||
"quiet"
|
||||
"splash"
|
||||
]
|
||||
++ (if hasHardware "amd" then [ "amd_pstate=active" ] else [ ])
|
||||
++ (if hasHardware "amd" then [ ] else [ ])
|
||||
++ (if hasHardware "intel" then [ ] else [ ])
|
||||
++ (if hasHardware "nvidia" then [ ] else [ ])
|
||||
++ cfg.extraKernelParams;
|
||||
@@ -85,5 +93,6 @@ in
|
||||
++ (if hasHardware "nvidia" then [ "nouveau" ] else [ ])
|
||||
++ cfg.extraBlacklistedModules;
|
||||
};
|
||||
hardware.amdgpu.overdrive.enable = mkIf cfg.amdOverdrive.enable true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ in
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
hardware.graphics = {
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = flatten (
|
||||
@@ -121,6 +122,7 @@ in
|
||||
|
||||
extraPackages32 = flatten (concatMap (_: commonPackages32) cfg.vendors);
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = flatten (
|
||||
concatMap (
|
||||
@@ -145,10 +147,6 @@ in
|
||||
);
|
||||
}
|
||||
|
||||
(mkIf (hasVendor "amd") {
|
||||
hardware.amdgpu.overdrive.enable = true;
|
||||
})
|
||||
|
||||
(mkIf (hasVendor "nvidia") {
|
||||
hardware.nvidia = {
|
||||
package =
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
enable = true;
|
||||
};
|
||||
syncthing = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
};
|
||||
udiskie = {
|
||||
enable = true;
|
||||
|
||||
Reference in New Issue
Block a user