This commit is contained in:
mjallen18
2024-11-08 22:31:09 -06:00
parent 2743309214
commit 96a05612c6
13 changed files with 193 additions and 94 deletions

View File

@@ -4,14 +4,13 @@
config,
...
}:
with lib;
let
cfg = config.share.hardware.amd;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
boot.kernelParams = [ (if cfg.enable then "amdgpu.ppfeaturemask=0xffffffff" else null) ];
# Configure programs
@@ -26,9 +25,11 @@ in
# Hardware configs
hardware = {
# Enable graphics
graphics = {
opengl = {
enable = true;
enable32Bit = true;
extraPackages = [ pkgs.unstable.mesa ];
driSupport32Bit = true;
extraPackages32 = [ pkgs.unstable.pkgsi686Linux.mesa ];
};
};
@@ -49,7 +50,7 @@ in
};
# nixpkg is broken so need to manually define
systemd.services.lactd = mkIf cfg.lact.enable {
systemd.services.lactd = lib.mkIf cfg.lact.enable {
description = "AMDGPU Control Daemon";
path = [
pkgs.bash
@@ -64,7 +65,7 @@ in
# Configure environment
environment = {
systemPackages = mkIf cfg.lact.enable [ pkgs.lact ];
systemPackages = lib.mkIf cfg.lact.enable [ pkgs.lact ];
sessionVariables = lib.mkDefault { STEAM_FORCE_DESKTOPUI_SCALING = "1"; };
};
};