wayland: enable ozone via $NIXOS_OZONE_WL
Chrome, Chromium, VSCode, Slack, Signal, Discord, element-desktop, schildichat. For the latter two, the feature flag useWayland was removed and a wrapper script was provided.
This commit is contained in:
@@ -541,6 +541,19 @@
|
|||||||
using the PyPy interpreter were added.
|
using the PyPy interpreter were added.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
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 <literal>NIXOS_OZONE_WL=1</literal>
|
||||||
|
(for example via
|
||||||
|
<literal>environment.sessionVariables.NIXOS_OZONE_WL = "1"</literal>).
|
||||||
|
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.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <literal>influxdb2</literal> package was split into
|
The <literal>influxdb2</literal> package was split into
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||||||
## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
|
## Backward Incompatibilities {#sec-release-22.05-incompatibilities}
|
||||||
|
|
||||||
- `pkgs.ghc` now refers to `pkgs.targetPackages.haskellPackages.ghc`.
|
- `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
|
ensure that `pkgs.ghc` always runs on the host platform and compiles
|
||||||
for the target platform (similar to `pkgs.gcc` for example).
|
for the target platform (similar to `pkgs.gcc` for example).
|
||||||
`haskellPackages.ghc` still behaves as before, running on the build
|
`haskellPackages.ghc` still behaves as before, running on the build
|
||||||
@@ -177,7 +177,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
|
to allow users to make changes to the `nixos-rebuild build-vm` configuration
|
||||||
that do not apply to their normal system.
|
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`
|
value from `vmVariant`. Configurations that import the `virtualisation/qemu-vm.nix`
|
||||||
module themselves will override this value, such that `vmVariant` is not used.
|
module themselves will override this value, such that `vmVariant` is not used.
|
||||||
|
|
||||||
@@ -185,6 +185,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.
|
- 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
|
- The `influxdb2` package was split into `influxdb2-server` and
|
||||||
`influxdb2-cli`, matching the split that took place upstream. A
|
`influxdb2-cli`, matching the split that took place upstream. A
|
||||||
combined `influxdb2` package is still provided in this release for
|
combined `influxdb2` package is still provided in this release for
|
||||||
@@ -236,8 +244,9 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||||||
Plugins are automatically repackaged using autoPatchelf.
|
Plugins are automatically repackaged using autoPatchelf.
|
||||||
|
|
||||||
- The `zrepl` package has been updated from 0.4.0 to 0.5:
|
- 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`.
|
- Renamed option `services.openssh.challengeResponseAuthentication` to `services.openssh.kbdInteractiveAuthentication`.
|
||||||
Reason is that the old name has been deprecated upstream.
|
Reason is that the old name has been deprecated upstream.
|
||||||
|
|||||||
@@ -3,11 +3,10 @@ let
|
|||||||
wayland = { pkgs, ... }: {
|
wayland = { pkgs, ... }: {
|
||||||
imports = [ ./common/wayland-cage.nix ];
|
imports = [ ./common/wayland-cage.nix ];
|
||||||
|
|
||||||
services.cage.program = ''
|
services.cage.program = "${pkgs.vscodium}/bin/codium";
|
||||||
${pkgs.vscodium}/bin/codium \
|
|
||||||
--enable-features=UseOzonePlatform \
|
environment.variables.NIXOS_OZONE_WL = "1";
|
||||||
--ozone-platform=wayland
|
environment.variables.DISPLAY = "do not use";
|
||||||
'';
|
|
||||||
|
|
||||||
fonts.fonts = with pkgs; [ dejavu_fonts ];
|
fonts.fonts = with pkgs; [ dejavu_fonts ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ let
|
|||||||
gappsWrapperArgs+=(
|
gappsWrapperArgs+=(
|
||||||
# Add gio to PATH so that moving files to the trash works when not using a desktop environment
|
# Add gio to PATH so that moving files to the trash works when not using a desktop environment
|
||||||
--prefix PATH : ${glib.bin}/bin
|
--prefix PATH : ${glib.bin}/bin
|
||||||
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,8 @@ in stdenv.mkDerivation {
|
|||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
|
|
||||||
eval makeWrapper "${browserBinary}" "$out/bin/chromium" \
|
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
|
ed -v -s "$out/bin/chromium" << EOF
|
||||||
2i
|
2i
|
||||||
|
|||||||
@@ -142,8 +142,9 @@ in stdenv.mkDerivation {
|
|||||||
makeWrapper "$out/share/google/$appname/google-$appname" "$exe" \
|
makeWrapper "$out/share/google/$appname/google-$appname" "$exe" \
|
||||||
--prefix LD_LIBRARY_PATH : "$rpath" \
|
--prefix LD_LIBRARY_PATH : "$rpath" \
|
||||||
--prefix PATH : "$binpath" \
|
--prefix PATH : "$binpath" \
|
||||||
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addOpenGLRunpath.driverLink}/share" \
|
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
|
||||||
--add-flags ${escapeShellArg commandLineArgs}
|
--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
|
for elf in $out/share/google/$appname/{chrome,chrome-sandbox,${crashpadHandlerBinary},nacl_helper}; do
|
||||||
patchelf --set-rpath $rpath $elf
|
patchelf --set-rpath $rpath $elf
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
wrapProgram $out/opt/${binaryName}/${binaryName} \
|
wrapProgram $out/opt/${binaryName}/${binaryName} \
|
||||||
"''${gappsWrapperArgs[@]}" \
|
"''${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 XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
||||||
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName}
|
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
, Security
|
, Security
|
||||||
, AppKit
|
, AppKit
|
||||||
, CoreServices
|
, CoreServices
|
||||||
|
|
||||||
, useWayland ? false
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -82,7 +80,8 @@ mkYarnPackage rec {
|
|||||||
# LD_PRELOAD workaround for sqlcipher not found: https://github.com/matrix-org/seshat/issues/102
|
# LD_PRELOAD workaround for sqlcipher not found: https://github.com/matrix-org/seshat/issues/102
|
||||||
makeWrapper '${electron_exec}' "$out/bin/${executableName}" \
|
makeWrapper '${electron_exec}' "$out/bin/${executableName}" \
|
||||||
--set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher.so \
|
--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.
|
# Do not attempt generating a tarball for element-web again.
|
||||||
|
|||||||
+16
-15
@@ -7,13 +7,13 @@
|
|||||||
, makeDesktopItem
|
, makeDesktopItem
|
||||||
, copyDesktopItems
|
, copyDesktopItems
|
||||||
, fetchYarnDeps
|
, fetchYarnDeps
|
||||||
, yarn, nodejs, fixup_yarn_lock
|
, yarn
|
||||||
|
, nodejs
|
||||||
|
, fixup_yarn_lock
|
||||||
, electron
|
, electron
|
||||||
, Security
|
, Security
|
||||||
, AppKit
|
, AppKit
|
||||||
, CoreServices
|
, CoreServices
|
||||||
|
|
||||||
, useWayland ? false
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -88,7 +88,8 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
# executable wrapper
|
# executable wrapper
|
||||||
makeWrapper '${electron_exec}' "$out/bin/${executableName}" \
|
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
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
@@ -101,17 +102,17 @@ stdenv.mkDerivation rec {
|
|||||||
# https://github.com/schildichat/element-desktop/blob/sc/package.json
|
# https://github.com/schildichat/element-desktop/blob/sc/package.json
|
||||||
desktopItems = [
|
desktopItems = [
|
||||||
(makeDesktopItem {
|
(makeDesktopItem {
|
||||||
name = "schildichat-desktop";
|
name = "schildichat-desktop";
|
||||||
exec = "${executableName} %u";
|
exec = "${executableName} %u";
|
||||||
icon = "schildichat";
|
icon = "schildichat";
|
||||||
desktopName = "SchildiChat";
|
desktopName = "SchildiChat";
|
||||||
genericName = "Matrix Client";
|
genericName = "Matrix Client";
|
||||||
comment = meta.description;
|
comment = meta.description;
|
||||||
categories = "Network;InstantMessaging;Chat;";
|
categories = "Network;InstantMessaging;Chat;";
|
||||||
extraEntries = ''
|
extraEntries = ''
|
||||||
StartupWMClass=schildichat
|
StartupWMClass=schildichat
|
||||||
MimeType=x-scheme-handler/element;
|
MimeType=x-scheme-handler/element;
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ in stdenv.mkDerivation rec {
|
|||||||
gappsWrapperArgs+=(
|
gappsWrapperArgs+=(
|
||||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ] }"
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ] }"
|
||||||
${customLanguageWrapperArgs}
|
${customLanguageWrapperArgs}
|
||||||
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Fix the desktop link
|
# Fix the desktop link
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ let
|
|||||||
homepage = "https://slack.com";
|
homepage = "https://slack.com";
|
||||||
license = licenses.unfree;
|
license = licenses.unfree;
|
||||||
maintainers = with maintainers; [ mmahut ];
|
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 {
|
linux = stdenv.mkDerivation rec {
|
||||||
@@ -170,7 +170,8 @@ let
|
|||||||
rm $out/bin/slack
|
rm $out/bin/slack
|
||||||
makeWrapper $out/lib/slack/slack $out/bin/slack \
|
makeWrapper $out/lib/slack/slack $out/bin/slack \
|
||||||
--prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \
|
--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
|
# Fix the desktop link
|
||||||
substituteInPlace $out/share/applications/slack.desktop \
|
substituteInPlace $out/share/applications/slack.desktop \
|
||||||
|
|||||||
@@ -2929,9 +2929,10 @@ with pkgs;
|
|||||||
inherit (darwin.apple_sdk.frameworks) Security AppKit CoreServices;
|
inherit (darwin.apple_sdk.frameworks) Security AppKit CoreServices;
|
||||||
electron = electron_13;
|
electron = electron_13;
|
||||||
};
|
};
|
||||||
element-desktop-wayland = element-desktop.override {
|
element-desktop-wayland = writeScript "element-desktop-wayland" ''
|
||||||
useWayland = true;
|
#!/bin/sh
|
||||||
};
|
NIXOS_OZONE_WL=1 exec ${element-desktop}/bin/element-desktop "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
element-web = callPackage ../applications/networking/instant-messengers/element/element-web.nix {
|
element-web = callPackage ../applications/networking/instant-messengers/element/element-web.nix {
|
||||||
conf = config.element-web.conf or {};
|
conf = config.element-web.conf or {};
|
||||||
@@ -4923,9 +4924,10 @@ with pkgs;
|
|||||||
inherit (darwin.apple_sdk.frameworks) Security AppKit CoreServices;
|
inherit (darwin.apple_sdk.frameworks) Security AppKit CoreServices;
|
||||||
electron = electron_13;
|
electron = electron_13;
|
||||||
};
|
};
|
||||||
schildichat-desktop-wayland = schildichat-desktop.override {
|
schildichat-desktop-wayland = writeScript "schildichat-desktop-wayland" ''
|
||||||
useWayland = true;
|
#!/bin/sh
|
||||||
};
|
NIXOS_OZONE_WL=1 exec ${schildichat-desktop}/bin/schildichat-desktop "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
schildichat-web = callPackage ../applications/networking/instant-messengers/schildichat/schildichat-web.nix {
|
schildichat-web = callPackage ../applications/networking/instant-messengers/schildichat/schildichat-web.nix {
|
||||||
conf = config.schildichat-web.conf or {};
|
conf = config.schildichat-web.conf or {};
|
||||||
|
|||||||
Reference in New Issue
Block a user