Slack: Difference between revisions

imported>Patryk27
mNo edit summary
imported>Patryk27
No edit summary
Line 5: Line 5:
=== NixOS ===
=== NixOS ===


<syntaxhighlight lang="nix">
<syntaxHighlight lang="nix">
environment.systemPackages = with pkgs; [ slack ];
environment.systemPackages = with pkgs; [ slack ];
</syntaxhighlight>
</syntaxHighlight>


=== Non-NixOS ===
=== Non-NixOS ===
Line 19: Line 19:
=== Wayland ===
=== Wayland ===


Since Electron's support for Wayland is of somewhat beta-quality, by default Slack will run through Xwayland, making it hard to do screen-sharing or use it comfortably on 4k+ screens - fortunately, it's possible to run it natively by specifying a few parameters:
If you're using recent nixpkgs (from 2022-01-27), you can enable native Wayland support by launching Slack as:
 
<syntaxHighlight lang="console">
$ NIXOS_OZONE_WL=1 slack
</syntaxHighlight>
 
... or by simply specifying this option globally:
 
<syntaxHighlight lang="nix">
environment.sessionVariables.NIXOS_OZONE_WL = "1";
</syntaxHighlight>
 
If that doesn't work for you, you might be using an older nixpkgs where the <code>NIXOS_OZONE_WL</code> option didn't exist yet - in that case, you can launch Slack via:


<syntaxHighlight lang="console">
<syntaxHighlight lang="console">
Line 25: Line 37:
</syntaxHighlight>
</syntaxHighlight>


... or, which is a bit more convenient, by patching the derivation:
... or, which is a bit more convenient, patch its derivation:


<syntaxhighlight lang="nix">
<syntaxHighlight lang="nix">
{ lib, pkgs, ... }:
{ lib, pkgs, ... }:
let
let
Line 47: Line 59:
</syntaxHighlight>
</syntaxHighlight>


In either of the cases, if you want to use screen-sharing, you'll have to enable xdg-desktop-portal, too:
In all of the cases, if you want to use screen-sharing, you'll have to enable <code>xdg-desktop-portal</code>, too:


<syntaxhighlight lang="nix">
<syntaxHighlight lang="nix">
xdg = {
xdg = {
   portal = {
   portal = {
Line 60: Line 72:
   };
   };
};
};
</syntaxhighlight>
</syntaxHighlight>