Jump to content

Discord: Difference between revisions

From Official NixOS Wiki
Nyxar77 (talk | contribs)
mNo edit summary
Arborodin (talk | contribs)
general reformat of the page
Line 1: Line 1:
{{Infobox application
{{Infobox application
| name = Discord
| name = Discord
| image = Discord.svg
| type = instant messaging and VoIP social platform
| type = instant messaging and VoIP social platform
| image = Discord.svg
| developer = Discord Inc.
| developer = Discord Inc.
| website = https://discord.com/
| platform = Cross-platform (Linux, macOS, Windows, Web)
| platform = Cross-platform (Linux, macOS, Windows, Web)
| github = discord
| github = discord
| website = https://discord.com/
}}
}}


Line 15: Line 15:


=== Official Clients ===
=== Official Clients ===
Nixpkgs provides all three of Discord's release channels, accessible as <code>pkgs.discord</code>, <code>pkgs.discord-ptb</code>, and <code>pkgs.discord-canary</code> respectively. Add any of the previous derivations to your package's configuration. For [[NixOS]] this will be in <code>environment.systemPackages</code> or <code>users.users.<name>.packages</code>.
Nixpkgs provides all three of Discord's release channels: <code>pkgs.discord</code>, <code>pkgs.discord-ptb</code>, and <code>pkgs.discord-canary</code>. Add any of these packages in <code>environment.systemPackages</code> or <code>users.users.<name>.packages</code>.
{{file|configuration.nix|nix|3=
{{file|configuration.nix|nix|3=
{ config, lib, pkgs, ... }: {
{ config, lib, pkgs, ... }: {
  ...
  # This installs Discord PTB only for the user "alice"
  users.users.alice.packages = with pkgs; [
    discord-ptb
  ];
   # This will install Discord PTB for all users of the system
   # This will install Discord PTB for all users of the system
   environment.systemPackages = with pkgs; [
   environment.systemPackages = with pkgs; [
    discord-ptb
  ];
  # This installs Discord PTB only for the user "alice"
  users.users.alice.packages = with pkgs; [
     discord-ptb
     discord-ptb
   ];
   ];
}
}
}}
}}
{{Warning|Use of unofficial clients goes against Discord's [https://discord.com/terms TOS] and possesses the risk of permanently suspending your account from the platform!}}


=== Unofficial Clients ===
=== Unofficial Clients ===
Nixpkgs also provides a vast variety of community developed/modded Discord clients, which can usually serve as drop-in replacements for the official discord client with an extended set of features.
Nixpkgs also provides a vast variety of community developed/modded Discord clients, which can usually serve as drop-in replacements for the official discord client with an extended set of features.
{{Warning|The usage of such client's goes against Discord's [https://discord.com/terms TOS], and can result in your account being permanently suspended from the platform!}}


==== Legcord (formerly ArmCord)<ref>https://github.com/Legcord/Legcord</ref> ====
'''Legcord'''<ref>https://github.com/Legcord/Legcord</ref> is a lightweight alternative desktop client featuring built-in modding extensibility via Vencord and Equicord. Provided via <code>pkgs.legcord</code>.
Lightweight, alternative desktop client with built-in modding extensibility. Nixpkgs provides this client via <code>pkgs.legcord</code>.<syntaxhighlight lang="nixos">
{ config, lib, pkgs, ... }: {
  environment.systemPackages = with pkgs; [
    legcord
  ];
}
</syntaxhighlight>


==== BetterDiscord<ref>https://github.com/BetterDiscord/BetterDiscord</ref> ====
'''BetterDiscord'''<ref>https://github.com/BetterDiscord/BetterDiscord</ref> enhances Discord desktop app with new features. Installer provided via <code>pkgs.betterdiscordctl</code>, but users may prefer to instead run it one-off via cli:
Enhances Discord desktop app with new features. Nixpkgs provides the installer via <code>pkgs.betterdiscordctl</code>. This can be added to your configuration, though users may prefer to instead run it one-off via the [[Nix]] cli.<syntaxhighlight lang=console>
<syntaxhighlight lang=console>
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl install' # nix-legacy
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl install' # nix-legacy
$ nix run nixpkgs#betterdiscordctl -- install # nix3
$ nix run nixpkgs#betterdiscordctl -- install # nix3
Line 52: Line 46:
</syntaxhighlight>
</syntaxhighlight>


==== OpenAsar<ref>https://github.com/GooseMod/OpenAsar</ref> ====
'''OpenAsar'''<ref>https://github.com/GooseMod/OpenAsar</ref> is an open-source alternative to Discord's <code>app.asar</code>. Provided via <code>pkgs.openasar</code>, however, without usable client. Users should instead prefer to override the official discord package and add <code>withOpenASAR = true</code>:
Open-source alternative to Discord's <code>app.asar</code>. Nixpkgs provides this via <code>pkgs.openasar</code>, though this doesn't provide a usable client. Users should instead prefer overriding the official discord package and add <code>withOpenASAR = true</code>.<syntaxhighlight lang="nixos">
{{file|configuration.nix|nix|3=
{ config, lib, pkgs, ... }: {
{ config, lib, pkgs, ... }: {
  ...
   environment.systemPackages = with pkgs; [
   environment.systemPackages = with pkgs; [
     (discord.override {
     (discord.override {
       withOpenASAR = true;
       withOpenASAR = true;
       # withVencord = true; # can do this here too
       # withVencord = true; # complementary
     })
     })
   ];
   ];
}
}
</syntaxhighlight>
}}


==== Vencord<ref>https://github.com/Vendicated/Vencord</ref> ====
'''Vencord'''<ref>https://github.com/Vendicated/Vencord</ref>, the cutest Discord client mod. Standalone can be installed by overriding the official Discord package via <code>withVencord = true</code>:
The cutest Discord client mod. The standalone Vencord client can be installed by overriding the official Discord package via <code>withVencord = true</code>.
{{file|configuration.nix|nix|3=
{{File|3={ config, lib, pkgs, ... }: {
{ config, lib, pkgs, ... }: {
  ...
   environment.systemPackages = with pkgs; [
   environment.systemPackages = with pkgs; [
     (discord.override {
     (discord.override {
       # withOpenASAR = true; # can do this here too
       # withOpenASAR = true; # complementary
       withVencord = true;
       withVencord = true;
     })
     })
   ];
   ];
}|name=/etc/nixos/configuration.nix|lang=nix}}
}
}}


==== Vesktop<ref>https://github.com/Vencord/Vesktop</ref> ====
'''Vesktop<ref>https://github.com/Vencord/Vesktop</ref>''' is a customizable and privacy friendly desktop app by the developers of Discord's cutest client mod. Can be used via [[Home Manager]] or installed as a regular package via <code>pkgs.vesktop</code>:
As opposed to just Vencord, the same developers also offer an integrated solution which aims to make the Linux experience better.  
{{file|configuration.nix|nix|3=
 
{ config, lib, pkgs, ... }: {
It can be neatly managed via [[Home Manager]], or just installed as a regular package via <code>pkgs.vesktop</code>.
{{File|3={ config, lib, pkgs, ... }: {
   ...
   ...
   programs.vesktop = {
   programs.vesktop = {
Line 95: Line 90:
     };
     };
   };
   };
  ...
}
}|name=home.nix|lang=nix}}
}}
 
'''Equicord<ref>https://github.com/equicord/equicord</ref>''', other cutest Discord client mod. Provided via <code>pkgs.equicord</code>.
 
'''Equibop<ref>https://github.com/Equicord/equibop</ref>''', a Vesktop fork by Equicord developers. Provided via  <code>pkgs.equibop</code>.
 
'''Dissent<ref>https://github.com/diamondburned/dissent</ref>''' is a client offering streamlined Discord experience, prioritizing simplicity and speed over feature completeness. Provided via <code>pkgs.dissent</code>.


==== Webcord<ref>https://github.com/SpacingBat3/WebCord</ref> ====
'''Webcord<ref>https://github.com/SpacingBat3/WebCord</ref>''' is a Discord and [https://spacebar.chat/ Spacebar] client implemented without using the official Discord API. Provided via <code>pkgs.webcord</code>.
Discord and [https://spacebar.chat/ Spacebar] client implemented without using the official Discord API. Nixpkgs provides this client via <code>pkgs.webcord</code>.<syntaxhighlight lang="nixos">
{ config, lib, pkgs, ... }: {
  environment.systemPackages = with pkgs; [
    webcord
  ];
}
</syntaxhighlight>


== Troubleshooting ==
== Troubleshooting ==
Line 114: Line 108:


=== Notifications causing crashes ===
=== Notifications causing crashes ===
Discord will crash if there is no compatible notification daemon running. This issue is only prevalent in custom desktop environments, such as [[Sway]] or [[Hyprland]]. Comprehensive documentation usually exists for most window managers/compositors and can be found on their respective wikis. Nixpkgs provides a few standalone notification daemons such as <code>pkgs.dunst</code> and <code>pkgs.mako</code>. You may optionally use a notification daemon from a larger DE, such as <code>pkgs.lxqt.lxqt-notificationd</code>, however it is unclear how effective these will be outside of their normal environment.<syntaxhighlight lang="nixos">
Discord will crash if there is no compatible notification daemon running. This issue is only prevalent in custom desktop environments, such as [[Sway]] or [[Hyprland]]. Comprehensive documentation usually exists for most window managers/compositors and can be found on their respective wikis. Nixpkgs provides a few standalone notification daemons such as <code>pkgs.dunst</code> and <code>pkgs.mako</code>. You may optionally use a notification daemon from a larger DE, such as <code>pkgs.lxqt.lxqt-notificationd</code>, however it is unclear how effective these will be outside of their normal environment.
<syntaxhighlight lang="nixos">
{ config, lib, pkgs, ... }: {
{ config, lib, pkgs, ... }: {
  ...
   # You will need to add a call for the daemon to actually function.
   # You will need to add a call for the daemon to actually function.
   # This is usually done within the configuration of your respective WM.
   # This is usually done within the configuration of your respective WM.
Line 130: Line 126:
=== "Must be your lucky day" popup ===
=== "Must be your lucky day" popup ===
Although Nixpkgs is usually very fast with updates (if you use ''nixos-unstable''), you may still run into this issue intermittently. You may override the discord package with a more up-to-date source, or you may disable this popup entirely by adding <code>"SKIP_HOST_UPDATE": true</code> to <code>~/.config/discord/settings.json</code>.
Although Nixpkgs is usually very fast with updates (if you use ''nixos-unstable''), you may still run into this issue intermittently. You may override the discord package with a more up-to-date source, or you may disable this popup entirely by adding <code>"SKIP_HOST_UPDATE": true</code> to <code>~/.config/discord/settings.json</code>.
{{File|~/.config/discord/settings.json|json|
{{file|~/.config/discord/settings.json|json|
{
{
   "SKIP_HOST_UPDATE": true
   "SKIP_HOST_UPDATE": true
Line 139: Line 135:
The Krisp noise suppression option will not work on NixOS because the Discord binary is patched before installation, and there is a DRM-style integrity check in the Krisp binary which prevents Krisp from working if the Discord binary is modified. See https://github.com/NixOS/nixpkgs/issues/195512 for details.
The Krisp noise suppression option will not work on NixOS because the Discord binary is patched before installation, and there is a DRM-style integrity check in the Krisp binary which prevents Krisp from working if the Discord binary is modified. See https://github.com/NixOS/nixpkgs/issues/195512 for details.


==== Python Script Workaround ====
==== Python script workaround ====
{{Warning|The usage of such modifications goes against Discord's [https://discord.com/terms Terms of Service] and  Krisp's [https://krisp.ai/terms-of-use/ Terms of Use] and can result in your Discord account being terminated and/or being banned from using Krisp's services!}}
{{Warning|The usage of such modifications goes against Discord's [https://discord.com/terms Terms of Service] and  Krisp's [https://krisp.ai/terms-of-use/ Terms of Use] and can result in your Discord account being terminated and/or being banned from using Krisp's services!}}


One way to enable Krisp noise suppression is by patching the <code>discord_krisp.node</code> binary to bypass its DRM verification. Below is a Nix configuration that creates a Python script that patches the binary by modifying specific bytes to bypass the license check: <syntaxhighlight lang="nixos">{ pkgs, ... }:
One way to enable Krisp noise suppression is by patching the <code>discord_krisp.node</code> binary to bypass its DRM verification. Below is a Nix configuration that creates a Python script that patches the binary by modifying specific bytes to bypass the license check:
<syntaxhighlight lang="nixos">
{ pkgs, ... }:
let
let
   krisp-patcher =
   krisp-patcher =
Line 187: Line 185:
(pkgs.discord.override { withTTS = true; })
(pkgs.discord.override { withTTS = true; })
</syntaxhighlight>
</syntaxhighlight>
[[Category:Applications]]
[[Category:Gaming]]


=== Discord RPC not functioning ===
=== Discord RPC not functioning ===
 
Install arRPC<ref>https://github.com/OpenAsar/arrpc</ref>:
==== NixOS ====
{{file|configuration.nix|nix|3=
Install [https://github.com/OpenAsar/arrpc arRPC]:
{ pkgs, ... }: {
<syntaxhighlight lang="nixos">
  ...
{pkgs, ...}:{
   enviroment.systemPackages = with pkgs; [
   enviroment.systemPackages = with pkgs; [
     arrpc
     arrpc
   ];
   ];
   systemd.packages = with pkgs; [ arrpc ];
   systemd.packages = with pkgs; [
    arrpc
  ];
}
}
</syntaxhighlight>
}}


==== Home Manager ====
Or add the following to your Home Manager configuration:
Add the following to your Home Manager configuration
{{file|home.nix|nix|3=
<syntaxhighlight lang="nixos">
{ pkgs, ... }: {
{pkgs, ...}:{
  ...
   services.arrpc = {
   services.arrpc = {
     enable = true;
     enable = true;
     package = pkgs.arrpc; # Default
     package = pkgs.arrpc; # Default
     systemdTarget = "graphical-session.target"; # Default
     systemdTarget = "graphical-session.target"; # default
   };
   };
}
}
</syntaxhighlight>
}}
 
[[Category:Applications]]
[[Category:Gaming]]

Revision as of 16:34, 12 September 2026

Discord

instant messaging and VoIP social platform Application

100%
Developer(s)Discord Inc.
Platform(s)Cross-platform (Linux, macOS, Windows, Web)
External links
Websitehttps://discord.com/
GitHubdiscord

Discord is an instant messaging and VoIP application with lots of functionality. It provides a web interface, though most users would prefer to use a client for interoperability with their system.

Installation

🟆︎
Tip: This package is unfree, and will require extra steps to install. You can read more about allowing unfree software in the Nixpkgs Manual.

Official Clients

Nixpkgs provides all three of Discord's release channels: pkgs.discord, pkgs.discord-ptb, and pkgs.discord-canary. Add any of these packages in environment.systemPackages or users.users.<name>.packages.

❄︎ configuration.nix
{ config, lib, pkgs, ... }: {
  ...
  # This installs Discord PTB only for the user "alice"
  users.users.alice.packages = with pkgs; [
    discord-ptb
  ];
  # This will install Discord PTB for all users of the system
  environment.systemPackages = with pkgs; [
    discord-ptb
  ];
}
⚠︎
Warning: Use of unofficial clients goes against Discord's TOS and possesses the risk of permanently suspending your account from the platform!

Unofficial Clients

Nixpkgs also provides a vast variety of community developed/modded Discord clients, which can usually serve as drop-in replacements for the official discord client with an extended set of features.

Legcord[1] is a lightweight alternative desktop client featuring built-in modding extensibility via Vencord and Equicord. Provided via pkgs.legcord.

BetterDiscord[2] enhances Discord desktop app with new features. Installer provided via pkgs.betterdiscordctl, but users may prefer to instead run it one-off via cli:

$ nix-shell -p betterdiscordctl --command 'betterdiscordctl install' # nix-legacy
$ nix run nixpkgs#betterdiscordctl -- install # nix3

$ nix-shell -p betterdiscordctl --command 'betterdiscordctl self-upgrade' # nix-legacy
$ nix run nixpkgs#betterdiscordctl -- self-upgrade # nix3

OpenAsar[3] is an open-source alternative to Discord's app.asar. Provided via pkgs.openasar, however, without usable client. Users should instead prefer to override the official discord package and add withOpenASAR = true:

❄︎ configuration.nix
{ config, lib, pkgs, ... }: {
  ...
  environment.systemPackages = with pkgs; [
    (discord.override {
      withOpenASAR = true;
      # withVencord = true; # complementary
    })
  ];
}

Vencord[4], the cutest Discord client mod. Standalone can be installed by overriding the official Discord package via withVencord = true:

❄︎ configuration.nix
{ config, lib, pkgs, ... }: {
  ...
  environment.systemPackages = with pkgs; [
    (discord.override {
      # withOpenASAR = true; # complementary
      withVencord = true;
    })
  ];
}

Vesktop[5] is a customizable and privacy friendly desktop app by the developers of Discord's cutest client mod. Can be used via Home Manager or installed as a regular package via pkgs.vesktop:

❄︎ configuration.nix
{ config, lib, pkgs, ... }: {
  ...
  programs.vesktop = {
    enable = true;

    vencord.settings = {
      autoUpdate = true;
      autoUpdateNotification = true;
      notifyAboutUpdates = true;

      plugins = {
        ClearURLs.enabled = true;
        FixYoutubeEmbeds.enabled = true;
      };
    };
  };
}

Equicord[6], other cutest Discord client mod. Provided via pkgs.equicord.

Equibop[7], a Vesktop fork by Equicord developers. Provided via pkgs.equibop.

Dissent[8] is a client offering streamlined Discord experience, prioritizing simplicity and speed over feature completeness. Provided via pkgs.dissent.

Webcord[9] is a Discord and Spacebar client implemented without using the official Discord API. Provided via pkgs.webcord.

Troubleshooting

Screen sharing on Wayland

Since December 2024, Discord Canary supports screen sharing on Wayland. Alternatively, you can use the web version on a browser that supports screen sharing on Wayland, or an unofficial client like Webcord or Vesktop, both of which have fixed this issue in their own ways.

Note: Remember to configure an XDG Desktop Portal with screen cast capabilities!

Notifications causing crashes

Discord will crash if there is no compatible notification daemon running. This issue is only prevalent in custom desktop environments, such as Sway or Hyprland. Comprehensive documentation usually exists for most window managers/compositors and can be found on their respective wikis. Nixpkgs provides a few standalone notification daemons such as pkgs.dunst and pkgs.mako. You may optionally use a notification daemon from a larger DE, such as pkgs.lxqt.lxqt-notificationd, however it is unclear how effective these will be outside of their normal environment.

{ config, lib, pkgs, ... }: {
  ...
  # You will need to add a call for the daemon to actually function.
  # This is usually done within the configuration of your respective WM.
  # See the official wiki/documentation for your WM for more info.
  environment.systemPackages = with pkgs; [
    mako
  ];
}

Crash on start-up

Occasionally, Discord's code can become corrupted, causing it to crash on start-up. You can force it to re-download the latest version by deleting the ~/.config/discord/1.0.138directory, where 1.0.138 is replaced with Discord's current version number (the second line of output when running discord from a terminal).

"Must be your lucky day" popup

Although Nixpkgs is usually very fast with updates (if you use nixos-unstable), you may still run into this issue intermittently. You may override the discord package with a more up-to-date source, or you may disable this popup entirely by adding "SKIP_HOST_UPDATE": true to ~/.config/discord/settings.json.

≡︎ ~/.config/discord/settings.json
{
  "SKIP_HOST_UPDATE": true
}

Krisp noise suppression

The Krisp noise suppression option will not work on NixOS because the Discord binary is patched before installation, and there is a DRM-style integrity check in the Krisp binary which prevents Krisp from working if the Discord binary is modified. See https://github.com/NixOS/nixpkgs/issues/195512 for details.

Python script workaround

⚠︎
Warning: The usage of such modifications goes against Discord's Terms of Service and Krisp's Terms of Use and can result in your Discord account being terminated and/or being banned from using Krisp's services!

One way to enable Krisp noise suppression is by patching the discord_krisp.node binary to bypass its DRM verification. Below is a Nix configuration that creates a Python script that patches the binary by modifying specific bytes to bypass the license check:

{ pkgs, ... }:
let
  krisp-patcher =
    pkgs.writers.writePython3Bin "krisp-patcher"
      {
        libraries = with pkgs.python3Packages; [
          capstone
          pyelftools
        ];
        flakeIgnore = [
          "E501" # line too long (82 > 79 characters)
          "F403" # 'from module import *' used; unable to detect undefined names
          "F405" # name may be undefined, or defined from star imports: module
        ];
      }
      (
        builtins.readFile (
          pkgs.fetchurl {
            url = "https://pastebin.com/raw/8tQDsMVd";
            sha256 = "sha256-IdXv0MfRG1/1pAAwHLS2+1NESFEz2uXrbSdvU9OvdJ8=";
          }
        )
      );
in
{
  environment.systemPackages = [
    krisp-patcher
  ];
}
Note: As of version 0.0.76, the script works. But, future versions of Discord may break the script. Therefore, you should not rely on this script for long-term use. For the latest updates and more details, follow https://github.com/NixOS/nixpkgs/issues/195512.

After adding this to your Nix configuration and rebuilding, make sure Discord is completely closed, and then run:

$ krisp-patcher ~/.config/discord/0.0.76/modules/discord_krisp/discord_krisp.node

Once you restart Discord and join a VC, you should see a sound wave icon to the left of the hangup icon.

Text-to-Speech

TTS is disabled by default; you may enable it via an override:

(pkgs.discord.override { withTTS = true; })

Discord RPC not functioning

Install arRPC[10]:

❄︎ configuration.nix
{ pkgs, ... }: {
  ...
  enviroment.systemPackages = with pkgs; [
    arrpc
  ];
  systemd.packages = with pkgs; [
    arrpc
  ];
}

Or add the following to your Home Manager configuration:

❄︎ home.nix
{ pkgs, ... }: {
  ...
  services.arrpc = {
    enable = true;
    package = pkgs.arrpc; # Default
    systemdTarget = "graphical-session.target"; # default
  };
}