348 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 *

This commit is contained in:
Max Känner 2024-05-26 18:39:40 +02:00
parent 0be300aa7b
commit 1a7ab84cbd
3 changed files with 42 additions and 15 deletions

View File

@ -17,21 +17,10 @@
myConfig = {
enable = true;
desktop = true;
gpu.amd.enable = true;
laptop = true;
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
libvdpau-va-gl
libvdpau
libva
rocmPackages.clr.icd
amdvlk
driversi686Linux.amdvlk
];
};
networking.hostName = "MaxNixosLaptop"; # Define your hostname.
# NIXOS
@ -161,8 +150,6 @@
'';
};
services.flatpak.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;

View File

@ -5,7 +5,7 @@
}: let
cfg = config.myConfig;
in {
imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix];
imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix];
options.myConfig = {
enable = lib.mkEnableOption "my custom config";

40
modules/nixos/gpu/amd.nix Normal file
View File

@ -0,0 +1,40 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.gpu.amd;
in {
options.myConfig.gpu.amd = {
enable = lib.mkEnableOption "enable amd gpu hardware acceleration";
};
config = lib.mkIf cfg.enable {
boot.initrd.kernelModules = ["amdgpu"];
services.xserver.videoDrivers = ["amdgpu"];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
rocmPackages.clr.icd
amdvlk
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
glxinfo
vulkan-tools
gpu-viewer
];
};
}