From c286cf9903f9c4e8ee28779d2fa7546974697aa4 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Tue, 8 Jun 2021 15:07:11 +0300 Subject: [PATCH] stuff --- hosts/lungmen.nix | 14 ++++++++++++-- overlays/discord-canary-system.nix | 8 ++++++++ users/patriot/default.nix | 26 ++++++++++++++++---------- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/hosts/lungmen.nix b/hosts/lungmen.nix index 28ca6b4..6d3d10f 100644 --- a/hosts/lungmen.nix +++ b/hosts/lungmen.nix @@ -143,9 +143,18 @@ in vaapiVdpau libva vulkan-loader + vulkan-validation-layers + vulkan-extension-layer ]; extraPackages32 = with pkgs.pkgsi686Linux; - [ libvdpau-va-gl vaapiVdpau libva vulkan-loader ] + [ + libvdpau-va-gl + vaapiVdpau + libva + vulkan-loader + vulkan-validation-layers + vulkan-extension-layer + ] ++ [ pkgs.driversi686Linux.amdvlk ]; }; pulseaudio = { @@ -162,8 +171,9 @@ in directories = [ "/etc/nixos" ]; files = [ "/etc/machine-id" ]; }; - variables = { + sessionVariables = { VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json"; + LD_LIBRARY_PATH = lib.mkForce "${lib.makeLibraryPath (config.hardware.opengl.extraPackages ++ config.hardware.opengl.extraPackages32)}"; }; }; networking.interfaces.enp6s0.useDHCP = true; diff --git a/overlays/discord-canary-system.nix b/overlays/discord-canary-system.nix index 2f1899a..723840b 100644 --- a/overlays/discord-canary-system.nix +++ b/overlays/discord-canary-system.nix @@ -69,6 +69,10 @@ final: prev: rec { , libappindicator-gtk3 , libdbusmenu , nodePackages + , vulkan-loader + , vulkan-validation-layers + , vulkan-extension-layer + , libGL }: stdenv.mkDerivation rec { inherit pname version src; @@ -130,6 +134,10 @@ final: prev: rec { libXScrnSaver libappindicator-gtk3 libdbusmenu + vulkan-loader + vulkan-validation-layers + vulkan-extension-layer + libGL ]; flags = (lib.optionals isWayland [ diff --git a/users/patriot/default.nix b/users/patriot/default.nix index 05dbd4e..d4dffee 100644 --- a/users/patriot/default.nix +++ b/users/patriot/default.nix @@ -133,8 +133,6 @@ in "--enable-gpu-rasterization" "--enable-zero-copy" "--disable-gpu-driver-bug-workarounds" - # "--enable-features=VaapiVideoDecoder" - # "--use-gl=egl" ]; in pkgs.writeScriptBin "chromium-wayland" '' @@ -154,8 +152,6 @@ in "--enable-gpu-rasterization" "--enable-zero-copy" "--disable-gpu-driver-bug-workarounds" - # "--enable-features=VaapiVideoDecoder" - # "--use-gl=egl" ]; in pkgs.writeScriptBin "vscodium-wayland" '' @@ -175,12 +171,17 @@ in pkgs.stdenv.mkDerivation { name = name; - phases = [ "installPhase" ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + phases = [ "installPhase" "fixupPhase" ]; installPhase = '' - mkdir $out - ln -s ${vscodiumWayland}/bin $out/bin + mkdir -p $out/bin + ln -s ${vscodiumWayland}/bin/${name} $out/bin ln -s ${desktop}/share $out/share ''; + fixupPhase = '' + wrapProgram $out/bin/${name} \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with pkgs; [ vulkan-loader vulkan-validation-layers vulkan-extension-layer libGL ])} + ''; }; chromiumWaylandPkg = let @@ -196,12 +197,17 @@ in pkgs.stdenv.mkDerivation { name = name; - phases = [ "installPhase" ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + phases = [ "installPhase" "fixupPhase" ]; installPhase = '' - mkdir $out - ln -s ${chromiumWayland}/bin $out/bin + mkdir -p $out/bin + ln -s ${chromiumWayland}/bin/${name} $out/bin ln -s ${desktop}/share $out/share ''; + fixupPhase = '' + wrapProgram $out/bin/${name} \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with pkgs; [ vulkan-loader vulkan-validation-layers vulkan-extension-layer libGL ])} + ''; }; colorSchemeLight = {