diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
index c945112ca7a0..e99f786b33ce 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
@@ -600,6 +600,19 @@
using the PyPy interpreter were added.
+
+
+ If you are using Wayland you can choose to use the Ozone
+ Wayland support in Chrome and several Electron apps by setting
+ the environment variable NIXOS_OZONE_WL=1
+ (for example via
+ environment.sessionVariables.NIXOS_OZONE_WL = "1").
+ This is not enabled by default because Ozone Wayland is still
+ under heavy development and behavior is not always flawless.
+ Furthermore, not all Electron apps use the latest Electron
+ versions.
+
+
The influxdb2 package was split into
diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md
index e9ae1fa7ee7f..a8b717c6f846 100644
--- a/nixos/doc/manual/release-notes/rl-2205.section.md
+++ b/nixos/doc/manual/release-notes/rl-2205.section.md
@@ -60,7 +60,7 @@ In addition to numerous new and upgraded packages, this release has the followin
## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
- `pkgs.ghc` now refers to `pkgs.targetPackages.haskellPackages.ghc`.
- This *only* makes a difference if you are cross-compiling and will
+ This _only_ makes a difference if you are cross-compiling and will
ensure that `pkgs.ghc` always runs on the host platform and compiles
for the target platform (similar to `pkgs.gcc` for example).
`haskellPackages.ghc` still behaves as before, running on the build
@@ -181,7 +181,7 @@ In addition to numerous new and upgraded packages, this release has the followin
to allow users to make changes to the `nixos-rebuild build-vm` configuration
that do not apply to their normal system.
- The `config.system.build.vm` attribute now always exists and defaults to the
+ The `config.system.build.vm` attribute now always exists and defaults to the
value from `vmVariant`. Configurations that import the `virtualisation/qemu-vm.nix`
module themselves will override this value, such that `vmVariant` is not used.
@@ -193,6 +193,14 @@ In addition to numerous new and upgraded packages, this release has the followin
- The `writers.writePyPy2`/`writers.writePyPy3` and corresponding `writers.writePyPy2Bin`/`writers.writePyPy3Bin` convenience functions to create executable Python 2/3 scripts using the PyPy interpreter were added.
+- If you are using Wayland you can choose to use the Ozone Wayland support
+ in Chrome and several Electron apps by setting the environment variable
+ `NIXOS_OZONE_WL=1` (for example via
+ `environment.sessionVariables.NIXOS_OZONE_WL = "1"`).
+ This is not enabled by default because Ozone Wayland is
+ still under heavy development and behavior is not always flawless.
+ Furthermore, not all Electron apps use the latest Electron versions.
+
- The `influxdb2` package was split into `influxdb2-server` and
`influxdb2-cli`, matching the split that took place upstream. A
combined `influxdb2` package is still provided in this release for
@@ -244,8 +252,9 @@ In addition to numerous new and upgraded packages, this release has the followin
Plugins are automatically repackaged using autoPatchelf.
- The `zrepl` package has been updated from 0.4.0 to 0.5:
- * The RPC protocol version was bumped; all zrepl daemons in a setup must be updated and restarted before replication can resume.
- * A bug involving encrypt-on-receive has been fixed. Read the [zrepl documentation](https://zrepl.github.io/configuration/sendrecvoptions.html#job-recv-options-placeholder) and check the output of `zfs get -r encryption,zrepl:placeholder PATH_TO_ROOTFS` on the receiver.
+
+ - The RPC protocol version was bumped; all zrepl daemons in a setup must be updated and restarted before replication can resume.
+ - A bug involving encrypt-on-receive has been fixed. Read the [zrepl documentation](https://zrepl.github.io/configuration/sendrecvoptions.html#job-recv-options-placeholder) and check the output of `zfs get -r encryption,zrepl:placeholder PATH_TO_ROOTFS` on the receiver.
- Renamed option `services.openssh.challengeResponseAuthentication` to `services.openssh.kbdInteractiveAuthentication`.
Reason is that the old name has been deprecated upstream.
diff --git a/nixos/tests/vscodium.nix b/nixos/tests/vscodium.nix
index 66baea73ec62..688ddfe07e3e 100644
--- a/nixos/tests/vscodium.nix
+++ b/nixos/tests/vscodium.nix
@@ -3,11 +3,10 @@ let
wayland = { pkgs, ... }: {
imports = [ ./common/wayland-cage.nix ];
- services.cage.program = ''
- ${pkgs.vscodium}/bin/codium \
- --enable-features=UseOzonePlatform \
- --ozone-platform=wayland
- '';
+ services.cage.program = "${pkgs.vscodium}/bin/codium";
+
+ environment.variables.NIXOS_OZONE_WL = "1";
+ environment.variables.DISPLAY = "do not use";
fonts.fonts = with pkgs; [ dejavu_fonts ];
};
diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix
index f2c262ece95d..72c753745168 100644
--- a/pkgs/applications/editors/vscode/generic.nix
+++ b/pkgs/applications/editors/vscode/generic.nix
@@ -108,6 +108,7 @@ let
gappsWrapperArgs+=(
# Add gio to PATH so that moving files to the trash works when not using a desktop environment
--prefix PATH : ${glib.bin}/bin
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
)
'';
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index c4521c89caa6..f296da05c313 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -183,7 +183,8 @@ in stdenv.mkDerivation {
mkdir -p "$out/bin"
eval makeWrapper "${browserBinary}" "$out/bin/chromium" \
- --add-flags ${escapeShellArg (escapeShellArg commandLineArgs)}
+ --add-flags ${escapeShellArg (escapeShellArg commandLineArgs)} \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
ed -v -s "$out/bin/chromium" << EOF
2i
diff --git a/pkgs/applications/networking/browsers/google-chrome/default.nix b/pkgs/applications/networking/browsers/google-chrome/default.nix
index e93ea8ca66d1..b0fc87a18014 100644
--- a/pkgs/applications/networking/browsers/google-chrome/default.nix
+++ b/pkgs/applications/networking/browsers/google-chrome/default.nix
@@ -142,8 +142,9 @@ in stdenv.mkDerivation {
makeWrapper "$out/share/google/$appname/google-$appname" "$exe" \
--prefix LD_LIBRARY_PATH : "$rpath" \
--prefix PATH : "$binpath" \
- --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addOpenGLRunpath.driverLink}/share" \
- --add-flags ${escapeShellArg commandLineArgs}
+ --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
+ --add-flags ${escapeShellArg commandLineArgs} \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
for elf in $out/share/google/$appname/{chrome,chrome-sandbox,${crashpadHandlerBinary},nacl_helper}; do
patchelf --set-rpath $rpath $elf
diff --git a/pkgs/applications/networking/instant-messengers/discord/linux.nix b/pkgs/applications/networking/instant-messengers/discord/linux.nix
index 866b28890948..c9e642aceb99 100644
--- a/pkgs/applications/networking/instant-messengers/discord/linux.nix
+++ b/pkgs/applications/networking/instant-messengers/discord/linux.nix
@@ -80,6 +80,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/opt/${binaryName}/${binaryName} \
"''${gappsWrapperArgs[@]}" \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName}
diff --git a/pkgs/applications/networking/instant-messengers/element/element-desktop.nix b/pkgs/applications/networking/instant-messengers/element/element-desktop.nix
index 1a0c25c606b0..5ba7a1f7b205 100644
--- a/pkgs/applications/networking/instant-messengers/element/element-desktop.nix
+++ b/pkgs/applications/networking/instant-messengers/element/element-desktop.nix
@@ -12,8 +12,6 @@
, Security
, AppKit
, CoreServices
-
-, useWayland ? false
}:
let
@@ -82,7 +80,8 @@ mkYarnPackage rec {
# LD_PRELOAD workaround for sqlcipher not found: https://github.com/matrix-org/seshat/issues/102
makeWrapper '${electron_exec}' "$out/bin/${executableName}" \
--set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher.so \
- --add-flags "$out/share/element/electron${lib.optionalString useWayland " --enable-features=UseOzonePlatform --ozone-platform=wayland"}"
+ --add-flags "$out/share/element/electron" \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
'';
# Do not attempt generating a tarball for element-web again.
diff --git a/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix b/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix
index 4e1d330f5000..f16c7b599e4a 100644
--- a/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix
+++ b/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix
@@ -7,13 +7,13 @@
, makeDesktopItem
, copyDesktopItems
, fetchYarnDeps
-, yarn, nodejs, fixup_yarn_lock
+, yarn
+, nodejs
+, fixup_yarn_lock
, electron
, Security
, AppKit
, CoreServices
-
-, useWayland ? false
}:
let
@@ -88,7 +88,8 @@ stdenv.mkDerivation rec {
# executable wrapper
makeWrapper '${electron_exec}' "$out/bin/${executableName}" \
- --add-flags "$out/share/element/electron${lib.optionalString useWayland " --enable-features=UseOzonePlatform --ozone-platform=wayland"}"
+ --add-flags "$out/share/element/electron" \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
runHook postInstall
'';
@@ -101,17 +102,17 @@ stdenv.mkDerivation rec {
# https://github.com/schildichat/element-desktop/blob/sc/package.json
desktopItems = [
(makeDesktopItem {
- name = "schildichat-desktop";
- exec = "${executableName} %u";
- icon = "schildichat";
- desktopName = "SchildiChat";
- genericName = "Matrix Client";
- comment = meta.description;
- categories = "Network;InstantMessaging;Chat;";
- extraEntries = ''
- StartupWMClass=schildichat
- MimeType=x-scheme-handler/element;
- '';
+ name = "schildichat-desktop";
+ exec = "${executableName} %u";
+ icon = "schildichat";
+ desktopName = "SchildiChat";
+ genericName = "Matrix Client";
+ comment = meta.description;
+ categories = "Network;InstantMessaging;Chat;";
+ extraEntries = ''
+ StartupWMClass=schildichat
+ MimeType=x-scheme-handler/element;
+ '';
})
];
diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
index 5ed9c192b68a..7489e765acac 100644
--- a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
+++ b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
@@ -123,6 +123,7 @@ in stdenv.mkDerivation rec {
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ] }"
${customLanguageWrapperArgs}
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
)
# Fix the desktop link
diff --git a/pkgs/applications/networking/instant-messengers/slack/default.nix b/pkgs/applications/networking/instant-messengers/slack/default.nix
index 5e0175518716..2ba8fcf579c9 100644
--- a/pkgs/applications/networking/instant-messengers/slack/default.nix
+++ b/pkgs/applications/networking/instant-messengers/slack/default.nix
@@ -84,7 +84,7 @@ let
homepage = "https://slack.com";
license = licenses.unfree;
maintainers = with maintainers; [ mmahut ];
- platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin"];
+ platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
};
linux = stdenv.mkDerivation rec {
@@ -170,7 +170,8 @@ let
rm $out/bin/slack
makeWrapper $out/lib/slack/slack $out/bin/slack \
--prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \
- --prefix PATH : ${lib.makeBinPath [xdg-utils]}
+ --prefix PATH : ${lib.makeBinPath [xdg-utils]} \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
# Fix the desktop link
substituteInPlace $out/share/applications/slack.desktop \
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4ecdc0061043..5d711a699025 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2929,9 +2929,10 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security AppKit CoreServices;
electron = electron_13;
};
- element-desktop-wayland = element-desktop.override {
- useWayland = true;
- };
+ element-desktop-wayland = writeScript "element-desktop-wayland" ''
+ #!/bin/sh
+ NIXOS_OZONE_WL=1 exec ${element-desktop}/bin/element-desktop "$@"
+ '';
element-web = callPackage ../applications/networking/instant-messengers/element/element-web.nix {
conf = config.element-web.conf or {};
@@ -4923,9 +4924,10 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security AppKit CoreServices;
electron = electron_13;
};
- schildichat-desktop-wayland = schildichat-desktop.override {
- useWayland = true;
- };
+ schildichat-desktop-wayland = writeScript "schildichat-desktop-wayland" ''
+ #!/bin/sh
+ NIXOS_OZONE_WL=1 exec ${schildichat-desktop}/bin/schildichat-desktop "$@"
+ '';
schildichat-web = callPackage ../applications/networking/instant-messengers/schildichat/schildichat-web.nix {
conf = config.schildichat-web.conf or {};