From d238074a4638a4ee37d16a0abb63904c2f17f20b Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Sun, 28 Jan 2024 02:12:50 -0600 Subject: [PATCH] Working more on profiles --- config/home/packages.nix | 4 ++-- config/system/amd-gpu.nix | 5 +++++ config/system/default.nix | 1 + config/system/intel-amd.nix | 28 ++++++++++++++++++++++++++++ flake.nix | 2 +- 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 config/system/intel-amd.nix diff --git a/config/home/packages.nix b/config/home/packages.nix index 15ee94e..59d6698 100644 --- a/config/home/packages.nix +++ b/config/home/packages.nix @@ -6,8 +6,8 @@ home.packages = with pkgs; [ pkgs."${browser}" discord libvirt swww grim slurp gnome.file-roller swaynotificationcenter rofi-wayland imv transmission-gtk mpv - gimp obs-studio blender kdenlive godot_4 rustup pavucontrol audacity - font-awesome spotify swayidle vim neovide neovim + gimp obs-studio blender-hip kdenlive godot_4 rustup audacity + font-awesome spotify swayidle vim neovide neovim pavucontrol (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) # Import Scripts (import ./../scripts/emopicker9000.nix { inherit pkgs; }) diff --git a/config/system/amd-gpu.nix b/config/system/amd-gpu.nix index 4a1eb48..abc2dfb 100644 --- a/config/system/amd-gpu.nix +++ b/config/system/amd-gpu.nix @@ -1,6 +1,11 @@ { pkgs, config, lib, gpuType, ... }: lib.mkIf ("${gpuType}" == "amd") { + systemd.tmpfiles.rules = [ + "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" + ]; + services.xserver.enable = true; + services.xserver.videoDrivers = [ "amdgpu" ]; # OpenGL hardware.opengl = { ## amdvlk: an open-source Vulkan driver from AMD diff --git a/config/system/default.nix b/config/system/default.nix index a6984bf..19ec2ea 100644 --- a/config/system/default.nix +++ b/config/system/default.nix @@ -6,6 +6,7 @@ ./autorun.nix ./boot.nix ./displaymanager.nix + ./intel-amd.nix ./intel-gpu.nix ./intel-nvidia.nix ./nvidia.nix diff --git a/config/system/intel-amd.nix b/config/system/intel-amd.nix new file mode 100644 index 0000000..c1dbcb0 --- /dev/null +++ b/config/system/intel-amd.nix @@ -0,0 +1,28 @@ +{ pkgs, config, lib, gpuType, ... }: + +lib.mkIf ("${gpuType}" == "intel-amd") { + nixpkgs.config.packageOverrides = + pkgs: { + vaapiIntel = pkgs.vaapiIntel.override { + enableHybridCodec = true; + }; + }; + + # OpenGL + hardware.opengl = { + extraPackages = with pkgs; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + amdvlk + ]; + extraPackages32 = [ pkgs.driversi686Linux.amdvlk ]; + }; + + systemd.tmpfiles.rules = [ + "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" + ]; + services.xserver.enable = true; + services.xserver.videoDrivers = [ "amdgpu" ]; +} diff --git a/flake.nix b/flake.nix index 1a828fe..814f34b 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,7 @@ flakeDir = "/home/${username}/zaneyos"; # Driver selection profile # Options include amd (tested), intel, nvidia - # GPU hybrid options: intel-nvidia, amd-nvidia + # GPU hybrid options: intel-nvidia, intel-amd # vm for both if you are running a vm cpuType = "amd"; gpuType = "amd";