feat(work-pc): setup Wayland with NVIDIA's GBM backend

This commit is contained in:
Felix Schröter 2021-11-09 09:57:22 +01:00
parent 94936f5d01
commit 594e74dd43
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
4 changed files with 39 additions and 2 deletions

View file

@ -13,7 +13,7 @@
services.xserver.displayManager.gdm.enable = true;
services.xserver.displayManager.gdm.wayland = true;
services.xserver.displayManager.gdm.nvidiaWayland = true;
services.xserver.displayManager.defaultSession = "gnome-xorg";
# services.xserver.displayManager.defaultSession = "gnome-xorg";
services.xserver.desktopManager.gnome.enable = true;
services.xserver.desktopManager.gnome.extraGSettingsOverrides = ''
[org/gnome/desktop/input-sources]

View file

@ -49,6 +49,31 @@
, nvim-ts-context-commentstring }@inputs:
let
overlays = {
# newer packages that support NVIDIA's GBM Wayland backend
wayland = self: super: {
egl-wayland = super.egl-wayland.overrideAttrs (old: rec {
pname = "egl-wayland";
version = "1.1.9-master";
name = "${pname}-${version}";
src = self.fetchFromGitHub {
owner = "Nvidia";
repo = "egl-wayland";
rev = "daab8546eca8428543a4d958a2c53fc747f70672";
sha256 = "IrLeqBW74mzo2OOd5GzUPDcqaxrsoJABwYyuKTGtPsw=";
};
buildInputs = old.buildInputs ++ [ self.wayland-protocols ];
});
xwayland = super.xwayland.overrideAttrs (old: rec {
version = "21.1.3";
src = self.fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "xorg";
repo = "xserver";
rev = "xwayland-21.1.3";
sha256 = "VnFzKyxg/6gVBg+bHTwDbUwCQHWt04gmiaAFLSwg7XA=";
};
});
};
neovim = self: super:
with super.pkgs.vimUtils; {
neovim-nightly = neovim.packages.${self.system}.neovim;
@ -87,6 +112,7 @@
modules = [ nixosModules.flakeDefaults ];
overlays = [
nur.overlay
overlays.wayland
overlays.neovim
overlays.deconz
overlays.pop-shell

View file

@ -15,4 +15,12 @@
extraPackages = with pkgs; [ libvdpau-va-gl vaapiVdpau ];
extraPackages32 = with pkgs.pkgsi686Linux; [ libvdpau-va-gl vaapiVdpau ];
};
# NVIDIA GBM setup
environment.variables = {
GBM_BACKENDS_PATH = "/run/opengl-driver/lib/gbm";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
OCL_ICD_VENDORS = "/run/opengl-driver/etc/OpenCL/vendors";
};
}

View file

@ -69,7 +69,10 @@ in {
programs.firefox = {
enable = true;
package = with pkgs;
wrapFirefox firefox-unwrapped { cfg.enableFXCastBridge = true; };
wrapFirefox firefox-unwrapped {
forceWayland = true;
cfg.enableFXCastBridge = true;
};
profiles = {
private = {
id = 0;