53 lines
1.6 KiB
Nix
53 lines
1.6 KiB
Nix
{ lib, config, pkgs, inputs, pkgsVersion, ... }:
|
|
let cfg = config.custom.hardware.amd-gpu;
|
|
in {
|
|
options.custom.hardware.amd-gpu = {
|
|
enable = lib.mkEnableOption "Enables amd gpus";
|
|
};
|
|
|
|
config =
|
|
let
|
|
#mesa-new = pkgs.mesa-git.mesa.overrideAttrs (oldAttrs: {
|
|
# src = pkgs.fetchFromGitLab {
|
|
# domain = "gitlab.freedesktop.org";
|
|
# owner = "mesa";
|
|
# repo = "mesa";
|
|
# rev = "69a08fd9b229ee9e859bfca5f4f9052c84714f98";
|
|
# hash = "sha256-6vRcad3a3A/9945gkeFgRrjyoBrtsnZeDnG/zROIA2Q=";
|
|
# };
|
|
#});
|
|
|
|
mesa-new = pkgs.mesa-git.mesa.overrideAttrs (oldAttrs: {
|
|
src = pkgs.fetchFromGitLab {
|
|
domain = "gitlab.freedesktop.org";
|
|
owner = "hakzsam";
|
|
repo = "mesa";
|
|
rev = "9238ae542f15e4566430a540817e15a8ec079a59";
|
|
hash = "sha256-c/iV/V7m3GuatEuybaetHVIPm66/a6lC1wvV/GGtvnQ=";
|
|
};
|
|
});
|
|
in
|
|
lib.mkIf cfg.enable {
|
|
boot.kernelParams =
|
|
[ "amdgpu.ppfeaturemask=0xfff7ffff" "split_lock_detect=off" ];
|
|
|
|
hardware.graphics = {
|
|
enable = true;
|
|
enable32Bit = true;
|
|
package = lib.mkForce mesa-new.drivers;
|
|
#extraPackages = with pkgs; [ mesa-git.amdvlk ];
|
|
};
|
|
|
|
hardware.amdgpu.initrd.enable = lib.mkDefault true;
|
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
|
# controller (overclock, undervolt, fan curves)
|
|
environment.systemPackages = with pkgs; [
|
|
lact
|
|
nvtopPackages.amd
|
|
amdgpu_top
|
|
];
|
|
systemd.packages = with pkgs; [ lact ];
|
|
systemd.services.lactd.wantedBy = [ "multi-user.target" ];
|
|
};
|
|
}
|