From 3141f4bfaabe6db498f982531ff9b06294c780b6 Mon Sep 17 00:00:00 2001 From: Emmet Date: Mon, 27 May 2024 14:21:17 -0500 Subject: [PATCH] Fixes gpu/mesa/opengl version mismatches on hyprland --- system/hardware-configuration.nix | 6 +++--- system/wm/hyprland.nix | 15 +++++++++++++-- user/wm/hyprland/hyprland.nix | 13 +++++++------ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix index 910aa09..daf2657 100644 --- a/system/hardware-configuration.nix +++ b/system/hardware-configuration.nix @@ -8,9 +8,9 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "radeon" ]; + boot.initrd.kernelModules = [ "radeon" ]; + boot.kernelModules = [ "kvm-amd" "radeon" ]; boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; hardware.opengl.extraPackages = [ pkgs.amdvlk ]; hardware.opengl.extraPackages32 = [ pkgs.driversi686Linux.amdvlk ]; diff --git a/system/wm/hyprland.nix b/system/wm/hyprland.nix index fe5ac65..cd7fb2f 100644 --- a/system/wm/hyprland.nix +++ b/system/wm/hyprland.nix @@ -1,5 +1,6 @@ -{ inputs, pkgs, ... }: - +{ inputs, pkgs, lib, ... }: let + pkgs-hyprland = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +in { # Import wayland config imports = [ ./wayland.nix @@ -30,4 +31,14 @@ portalPackage = pkgs.xdg-desktop-portal-hyprland; }; }; + + # fixes opengl/mesa version mismatch + hardware.opengl = { + package = pkgs-hyprland.mesa.drivers; + + # if you also want 32-bit support (e.g for Steam) + driSupport32Bit = true; + package32 = pkgs-hyprland.pkgsi686Linux.mesa.drivers; + }; + services.xserver.displayManager.sddm.package = lib.mkForce pkgs-hyprland.sddm; } diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index f37db05..4b83b10 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -1,5 +1,6 @@ -{ inputs, config, lib, pkgs, userSettings, systemSettings, ... }: - +{ inputs, config, lib, pkgs, userSettings, systemSettings, ... }: let + pkgs-hyprland = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +in { imports = [ ../../app/terminal/alacritty.nix @@ -320,7 +321,7 @@ systemd.enable = true; }; - home.packages = with pkgs; [ + home.packages = (with pkgs; [ alacritty kitty feh @@ -368,7 +369,6 @@ hyprland-protocols hyprpicker hypridle - hyprlock swaybg fnott fuzzel @@ -449,8 +449,9 @@ terminal = false; icon = "emacs"; type = "Application"; - }) - ]; + })]) + ++ + (with pkgs-hyprland; [ hyprlock ]); home.file.".config/nwg-dock-hyprland/style.css".text = '' window { background: rgba(''+config.lib.stylix.colors.base00-rgb-r+'',''+config.lib.stylix.colors.base00-rgb-g+'',''+config.lib.stylix.colors.base00-rgb-b+'',0.0);