Slack: Difference between revisions

From NixOS Wiki
imported>Patryk27
mNo edit summary
Klinger (talk | contribs)
m Category:Applications
 
(4 intermediate revisions by 3 users not shown)
Line 5: Line 5:
=== NixOS ===
=== NixOS ===


<syntaxhighlight lang="nix">
<syntaxHighlight lang="nix">
environment.systemPackages = with pkgs; [ slack ];
environment.systemPackages = with pkgs; [ slack ];
</syntaxhighlight>
=== Non-NixOS ===
<syntaxHighlight lang="console">
$ nix-env -iA nixos.slack
</syntaxHighlight>
</syntaxHighlight>


Line 19: Line 13:
=== 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:
You can enable native Wayland support by launching Slack as:


<syntaxHighlight lang="console">
<syntaxHighlight lang="console">
$ slack --ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer
$ NIXOS_OZONE_WL=1 slack
</syntaxHighlight>
</syntaxHighlight>


... or, which is a bit more convenient, by patching the derivation:
... or by simply specifying this option globally:
 
<syntaxhighlight lang="nix">
{ lib, pkgs, ... }:
let
  slack = pkgs.slack.overrideAttrs (old: {
    installPhase = old.installPhase + ''
      rm $out/bin/slack


      makeWrapper $out/lib/slack/slack $out/bin/slack \
<syntaxHighlight lang="nix">
        --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \
environment.sessionVariables.NIXOS_OZONE_WL = "1";
        --prefix PATH : ${lib.makeBinPath [pkgs.xdg-utils]} \
        --add-flags "--ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer"
    '';
  });
 
in
{
  environment.systemPackages = [ slack ];
}
</syntaxHighlight>
</syntaxHighlight>


In either of the cases, if you want to use screen-sharing, you'll have to enable xdg-desktop-portal, too:
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 38:
   };
   };
};
};
</syntaxhighlight>
</syntaxHighlight>
 
==== Window decorations ====
 
If the above configuration leaves you without window decorations you may want to enable this feature as well:
<syntaxHighlight lang="console">
WaylandWindowDecorations
</syntaxHighlight>
 
 
[[Category:Applications]]

Latest revision as of 12:53, 19 April 2024

Slack is a communication platform with a desktop application based on Electron.

Installation

NixOS

environment.systemPackages = with pkgs; [ slack ];

Tips

Wayland

You can enable native Wayland support by launching Slack as:

$ NIXOS_OZONE_WL=1 slack

... or by simply specifying this option globally:

environment.sessionVariables.NIXOS_OZONE_WL = "1";

If you want to use screen-sharing, you'll have to enable xdg-desktop-portal, too:

xdg = {
  portal = {
    enable = true;
    extraPortals = with pkgs; [
      xdg-desktop-portal-wlr
      xdg-desktop-portal-gtk
    ];
    gtkUsePortal = true;
  };
};

Window decorations

If the above configuration leaves you without window decorations you may want to enable this feature as well:

WaylandWindowDecorations