Merge pull request #70295 from worldofpeace/mutter-eglstreams
Mutter eglstreams
This commit is contained in:
commit
1b5df99e7a
|
@ -111,9 +111,10 @@ in
|
||||||
config = mkIf enabled {
|
config = mkIf enabled {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = with config.services.xserver.displayManager; gdm.enable -> !gdm.wayland;
|
assertion = with config.services.xserver.displayManager; gdm.nvidiaWayland -> cfg.modesetting.enable;
|
||||||
message = "NVIDIA drivers don't support wayland, set services.xserver.displayManager.gdm.wayland=false";
|
message = "You cannot use wayland with GDM without modesetting enabled for NVIDIA drivers, set `hardware.nvidia.modesetting.enable = true`";
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
assertion = !optimusCfg.enable ||
|
assertion = !optimusCfg.enable ||
|
||||||
(optimusCfg.nvidiaBusId != "" && optimusCfg.intelBusId != "");
|
(optimusCfg.nvidiaBusId != "" && optimusCfg.intelBusId != "");
|
||||||
|
|
|
@ -126,11 +126,21 @@ in
|
||||||
wayland = mkOption {
|
wayland = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
Allow GDM run on Wayland instead of Xserver
|
Allow GDM to run on Wayland instead of Xserver.
|
||||||
|
Note to enable Wayland with Nvidia you need to
|
||||||
|
enable the <option>nvidiaWayland</option>.
|
||||||
'';
|
'';
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nvidiaWayland = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to allow wayland to be used with the proprietary
|
||||||
|
NVidia graphics driver.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
autoSuspend = mkOption {
|
autoSuspend = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -237,6 +247,19 @@ in
|
||||||
|
|
||||||
services.dbus.packages = [ gdm ];
|
services.dbus.packages = [ gdm ];
|
||||||
|
|
||||||
|
# We duplicate upstream's udev rules manually to make wayland with nvidia configurable
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
# disable Wayland on Cirrus chipsets
|
||||||
|
ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="${gdm}/libexec/gdm-disable-wayland"
|
||||||
|
# disable Wayland on Hi1710 chipsets
|
||||||
|
ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="${gdm}/libexec/gdm-disable-wayland"
|
||||||
|
${optionalString (!cfg.gdm.nvidiaWayland) ''
|
||||||
|
DRIVER=="nvidia", RUN+="${gdm}/libexec/gdm-disable-wayland"
|
||||||
|
''}
|
||||||
|
# disable Wayland when modesetting is disabled
|
||||||
|
IMPORT{cmdline}="nomodeset", RUN+="${gdm}/libexec/gdm-disable-wayland"
|
||||||
|
'';
|
||||||
|
|
||||||
systemd.user.services.dbus.wantedBy = [ "default.target" ];
|
systemd.user.services.dbus.wantedBy = [ "default.target" ];
|
||||||
|
|
||||||
programs.dconf.profiles.gdm =
|
programs.dconf.profiles.gdm =
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
, sysprof
|
, sysprof
|
||||||
, desktop-file-utils
|
, desktop-file-utils
|
||||||
, libcap_ng
|
, libcap_ng
|
||||||
|
, egl-wayland
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
@ -26,6 +27,8 @@ stdenv.mkDerivation rec {
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
"-Dxwayland-path=${xwayland}/bin/Xwayland"
|
"-Dxwayland-path=${xwayland}/bin/Xwayland"
|
||||||
"-Dinstalled_tests=false" # TODO: enable these
|
"-Dinstalled_tests=false" # TODO: enable these
|
||||||
|
"-Dwayland_eglstream=true"
|
||||||
|
"-Degl_device=true"
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
|
@ -52,7 +55,7 @@ stdenv.mkDerivation rec {
|
||||||
gnome-desktop cairo pango cogl zenity libstartup_notification
|
gnome-desktop cairo pango cogl zenity libstartup_notification
|
||||||
geocode-glib libinput libgudev libwacom
|
geocode-glib libinput libgudev libwacom
|
||||||
libcanberra-gtk3 zenity xkeyboard_config libxkbfile
|
libcanberra-gtk3 zenity xkeyboard_config libxkbfile
|
||||||
libxkbcommon pipewire xwayland
|
libxkbcommon pipewire xwayland egl-wayland
|
||||||
gnome-settings-daemon sysprof
|
gnome-settings-daemon sysprof
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
73
pkgs/development/libraries/egl-wayland/default.nix
Normal file
73
pkgs/development/libraries/egl-wayland/default.nix
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchFromGitHub
|
||||||
|
, pkgconfig
|
||||||
|
, meson
|
||||||
|
, ninja
|
||||||
|
, libX11
|
||||||
|
, mesa
|
||||||
|
, wayland
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
eglexternalplatform = stdenv.mkDerivation {
|
||||||
|
pname = "eglexternalplatform";
|
||||||
|
version = "1.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "Nvidia";
|
||||||
|
repo = "eglexternalplatform";
|
||||||
|
rev = "7c8f8e2218e46b1a4aa9538520919747f1184d86";
|
||||||
|
sha256 = "0lr5s2xa1zn220ghmbsiwgmx77l156wk54c7hybia0xpr9yr2nhb";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p "$out/include/"
|
||||||
|
cp interface/eglexternalplatform.h "$out/include/"
|
||||||
|
cp interface/eglexternalplatformversion.h "$out/include/"
|
||||||
|
|
||||||
|
substituteInPlace eglexternalplatform.pc \
|
||||||
|
--replace "/usr/include/EGL" "$out/include"
|
||||||
|
mkdir -p "$out/share/pkgconfig"
|
||||||
|
cp eglexternalplatform.pc "$out/share/pkgconfig/"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
license = licenses.mit;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
pname = "egl-wayland";
|
||||||
|
version = "1.1.4";
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "Nvidia";
|
||||||
|
repo = pname;
|
||||||
|
rev = version;
|
||||||
|
sha256 = "0wvamjcfycd7rgk7v14g2rin55xin9rfkxmivyay3cm08vnl7y1d";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
meson
|
||||||
|
ninja
|
||||||
|
pkgconfig
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
eglexternalplatform
|
||||||
|
libX11
|
||||||
|
mesa
|
||||||
|
wayland
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "The EGLStream-based Wayland external platform";
|
||||||
|
homepage = https://github.com/NVIDIA/egl-wayland/;
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
maintainers = with maintainers; [ hedning ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,16 +1,18 @@
|
||||||
{ stdenv, wayland, wayland-protocols, xorgserver, xkbcomp, xkeyboard_config, epoxy, libxslt, libunwind, makeWrapper }:
|
{ stdenv, wayland, wayland-protocols, xorgserver, xkbcomp, xkeyboard_config, epoxy, libxslt, libunwind, makeWrapper, egl-wayland }:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
xorgserver.overrideAttrs (oldAttrs: {
|
xorgserver.overrideAttrs (oldAttrs: {
|
||||||
|
|
||||||
name = "xwayland-${xorgserver.version}";
|
name = "xwayland-${xorgserver.version}";
|
||||||
|
buildInputs = oldAttrs.buildInputs ++ [ egl-wayland ];
|
||||||
propagatedBuildInputs = oldAttrs.propagatedBuildInputs
|
propagatedBuildInputs = oldAttrs.propagatedBuildInputs
|
||||||
++ [wayland wayland-protocols epoxy libxslt makeWrapper libunwind];
|
++ [wayland wayland-protocols epoxy libxslt makeWrapper libunwind];
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--disable-docs"
|
"--disable-docs"
|
||||||
"--disable-devel-docs"
|
"--disable-devel-docs"
|
||||||
"--enable-xwayland"
|
"--enable-xwayland"
|
||||||
|
"--enable-xwayland-eglstream"
|
||||||
"--disable-xorg"
|
"--disable-xorg"
|
||||||
"--disable-xvfb"
|
"--disable-xvfb"
|
||||||
"--disable-xnest"
|
"--disable-xnest"
|
||||||
|
|
|
@ -11030,6 +11030,8 @@ in
|
||||||
inherit (darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo;
|
inherit (darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
egl-wayland = callPackage ../development/libraries/egl-wayland {};
|
||||||
|
|
||||||
elastix = callPackage ../development/libraries/science/biology/elastix { };
|
elastix = callPackage ../development/libraries/science/biology/elastix { };
|
||||||
|
|
||||||
enchant1 = callPackage ../development/libraries/enchant/1.x.nix { };
|
enchant1 = callPackage ../development/libraries/enchant/1.x.nix { };
|
||||||
|
|
Loading…
Reference in a new issue