Jump to content

Discord: Difference between revisions

From Official NixOS Wiki
imported>Hypnosis2839
→Usage: change overlay to override, remove duplicate info
 
(36 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{unfree}}
{{Infobox application
| name = Discord
| image = Discord.svg
| type = instant messaging and VoIP social platform
| developer = Discord Inc.
| platform = Cross-platform (Linux, macOS, Windows, Web)
| github = discord
| website = https://discord.com/
}}
 
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 ==
== Installation ==
available builds
<nowiki>
discord
discord-ptb
discord-canary</nowiki>
replace the <code>discord</code> below with whichever build you want
=== NixOS ===


<syntaxhighlight lang="nix">
=== Official Clients ===
nixpkgs.config = {
{{tip/unfree}}
   allowUnfree = true;
 
};
Nixpkgs provides all three of Discord's release channels: {{nixos:package|discord}}, {{nixos:package|discord-ptb}}, and {{nixos:package|discord-canary}}. Add any of these packages in {{nixos:option|environment.systemPackages}} or <code>users.users.<name>.packages</code>
environment.systemPackages = with pkgs; [ discord ]
 
</syntaxhighlight>
{{file|configuration.nix|nix|3=
{ pkgs, ... }: {
  # This installs Discord only for the user "alice"
   users.users.alice.packages = with pkgs; [
    discord
  ];
 
  # This will install Discord PTB for all users of the system
  environment.systemPackages = with pkgs; [
    discord-ptb
  ];
}
}}
 
=== Unofficial Clients ===
{{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!}}


=== Home Manager ===
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.
Can be used on both NixOS and non-NixOS


Same as above but replace <code>environment.systemPackages</code> with <code>home.packages</code>
'''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 {{nixos:package|legcord}}.


=== Non-NixOS ===
'''GoofCord<ref>https://github.com/Milkshiift/GoofCord</ref>''' is a security oriented fork of Legcord. Provided via {{nixos:package|goofcord}}.
[https://nixos.org/manual/nixpkgs/stable/#sec-declarative-package-management declarative package management on non-nixos]


== Alternative packages ==
'''BetterDiscord<ref>https://github.com/BetterDiscord/BetterDiscord</ref>''' enhances Discord desktop app with new features. Installer provided via {{nixos:package|betterdiscordctl}}, but users may prefer to instead run it one-off via cli:


=== BetterDiscord ===
[https://betterdiscord.app BetterDiscord] is a client modification engine which allows you to use custom plugins, themes, and more. The easiest way to install this is using [https://github.com/bb010g/betterdiscordctl betterdiscordctl].
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
$ nix run nixpkgs#betterdiscordctl install
$ 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
</syntaxhighlight>
</syntaxhighlight>


=== OpenAsar / Vencord ===
'''OpenAsar<ref>https://github.com/GooseMod/OpenAsar</ref>''' is an open-source alternative to Discord's <code>app.asar</code>. Provided via {{nixos:package|openasar}} without usable client. Users should instead prefer to override the official discord package and add <code>withOpenASAR = true</code>:


You can use Discord [https://github.com/GooseMod/OpenAsar OpenAsar] and/or [https://github.com/Vendicated/Vencord Vencord] by replacing `pkgs.discord` in your config with the following override:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
(pkgs.discord.override {
(discord.override {
  # remove any overrides that you don't want
   withOpenASAR = true;
   withOpenASAR = true;
  #withVencord = true; # complementary
})
</syntaxhighlight>
'''Vencord<ref>https://github.com/Vendicated/Vencord</ref>''', the cutest Discord client mod. Provided via {{nixos:package|vencord}}. Standalone can be installed by overriding the official Discord package via <code>withVencord = true</code>:
<syntaxhighlight lang="nix">
(discord.override {
  #withOpenASAR = true; # complementary
   withVencord = true;
   withVencord = true;
})
})
</syntaxhighlight>
</syntaxhighlight>


== Join the NixOS Discord ==
'''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. Provided via {{nixos:package|vesktop}}. Can be configured in [[Home Manager]]:


Follow this link to join the unofficial NixOS Discord: https://discord.com/invite/RbvHtGa
{{file|home.nix|nix|3=
{ ... }: {
  programs.vesktop = {
    enable = true;


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


=== Discord crashes when a notification is received ===
      plugins = {
Discord crashes if there is no notification-daemon
        ClearURLs.enabled = true;
        FixYoutubeEmbeds.enabled = true;
      };
    };
  };
}
}}


standalone notification daemons
'''Equicord<ref>https://github.com/equicord/equicord</ref>''', other cutest Discord client mod. Provided via {{nixos:package|equicord}}.
{{app|dunst|Lightweight and customizable notification daemon for x11|https://github.com/dunst-project/dunst|dunst}}
{{app|mako|A lightweight Wayland notification daemon|https://github.com/emersion/mako/|mako}}


=== Discord wants latest version ===
'''Equibop<ref>https://github.com/Equicord/equibop</ref>''', a Vesktop fork by Equicord developers. Provided via {{nixos:package|equibop}}.


[[File:discord_update_latest.png]]
'''Dissent<ref>https://github.com/diamondburned/dissent</ref>''' is a simple, practical Discord client prioritizing speed over feature completeness. Provided via {{nixos:package|dissent}}.


Discord refuses to start because they have released an update and it wants to download that instead.
'''Discordo<ref>https://github.com/ayn2op/discordo</ref>''' is a TUI Discord client provided via {{nixos:package|discordo}}. ''Development in progress, possible crashes and breaking changes.''


To prevent Discord from checking for new versions, add the following to <code>~/.config/discord/settings.json</code>:
'''Webcord<ref>https://github.com/SpacingBat3/WebCord</ref>''' is a Discord and [https://spacebar.chat/ Spacebar] client implemented without using official Discord API. Provided via {{nixos:package|webcord}}.
<syntaxhighlight lang="json">
{
    "SKIP_HOST_UPDATE": true
}</syntaxhighlight>
If the file already exists the braces aren't necessary.


'''Ripcord<ref>https://cancel.fm/ripcord/</ref>''' is an unfree client for Discord and [https://slack.com/intl/ Slack] with a traditional compact interface for power users. Provided via {{nixos:package|ripcord}}.


Alternatively, you can install the updated version.
== Troubleshooting ==


If the version has already been updated in a newer version of nixpkgs, installing it works something like this:
=== Wayland screen sharing ===
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 [[Discord#Unofficial Clients|unofficial client]] like ''Webcord'' or ''Vesktop'', both of which have fixed this issue in their own ways.
{{Note|Remember to configure an [https://wiki.archlinux.org/title/XDG_Desktop_Portal#List_of_backends_and_interfaces XDG Desktop Portal] with screen cast capabilities!}}


<syntaxhighlight lang="nix">
=== Notifications-related crash ===
nixpkgs.overlays = [(self: super: { discord = super.discord.overrideAttrs (_: { src = builtins.fetchTarball <link-to-tarball>; });})];
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 {{nixos:package|dunst}} and {{nixos:package|mako}}. You may optionally use a notification daemon from a larger DE, such as {{nixos:package|lxqt.lxqt-notificationd}}, however it is unclear how effective these will be outside of their normal environment.
</syntaxhighlight>


An overlay to build discord manually from the URL to the latest tarball on [https://discord.com/api/download?platform=linux&format=tar.gz], see [https://github.com/NixOS/nixpkgs/issues/94806]
{{file|configuration.nix|nix|3=
{ 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
  ];
}
}}


If it was fixed in master, the other alternatives are:
=== Start-up crash ===
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 <code>~/.config/discord/1.0.138</code>directory, where <code>1.0.138</code> is replaced with Discord's current version number (the second line of output when running <code>discord</code> from a terminal).


<syntaxhighlight lang="console">
=== "Must be your lucky day" ===
nix-env -f https://github.com/NixOS/nixpkgs/archive/release-20.09.tar.gz -iA discord
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>:
</syntaxhighlight>
{{file|~/.config/discord/settings.json|json|
{
  "SKIP_HOST_UPDATE": true
<nowiki>}</nowiki>
}}


or with nix-shell:
=== 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 and related issues for details. This was fixed in the unstable channel of nixpkgs on August 10, 2026 (PR: https://github.com/NixOS/nixpkgs/pull/544831).


<syntaxhighlight lang="console">
==== Python script workaround ====
NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/release-20.09.tar.gz nix-shell -p discord --run Discord
{{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!}}
</syntaxhighlight>


=== Opening Links with Firefox ===
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:
If you use Discord and it silently fails to open links in Firefox, you possibly have encountered [https://github.com/NixOS/nixpkgs/issues/78961 issue #78961]. This is caused by a version mismatch between the NSS libraries used by Discord and Firefox. Luckily, a relatively easy workaround is available:


First, find out which NSS version Firefox is currently using with
<syntaxhighlight lang="console">
$ nix path-info $(which firefox) -r | grep nss-
</syntaxhighlight>
This should print a few store paths, focus on their ends, which should look like <code>nss-x.xx</code>. We're interested in the one with the newest version. Next, create a new file called <code>discord_patched.nix</code> and paste the following code into it:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
with import <nixpkgs> {};
{ pkgs, ... }:
 
let
pkgs.discord.override {
  krisp-patcher =
    nss = pkgs.nss_3_49_2;
    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
  ];
}
}
</syntaxhighlight>
</syntaxhighlight>


Now replace <code>nss_3_49_2</code> with the previously looked up version's "attribute name", which you can look up [https://search.nixos.org/packages/?query=nss_ here]. Finally, build and install this patched package with
{{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:
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
$ export NIXPKGS_ALLOW_UNFREE=1; nix-env -i $(nix-build discord_patched.nix) --arg config '{ allowUnfree = true; }'
$ krisp-patcher ~/.config/discord/0.0.76/modules/discord_krisp/discord_krisp.node
</syntaxhighlight>
</syntaxhighlight>


Log in again and you should be able to open links properly.
Once you restart Discord and join a VC, you should see a sound wave icon to the left of the hangup icon.
 
=== 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.


=== Text-to-Speech ===
=== Text-to-Speech ===
TTS is disabled by default, you may enable it via an overlay
TTS is disabled by default; you may enable it via an override:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
nixpkgs.overlays =
(pkgs.discord.override {
  let
  withTTS = true;
    myOverlay = self: super: {
})
      discord = super.discord.override { withTTS = true; };
    };
  in
  [ myOverlay ];
</syntaxhighlight>
</syntaxhighlight>


== Links ==
=== Discord RPC not functioning ===
[https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/instant-messengers/discord/default.nix default.nix for discord]
Install '''arRPC'''<ref>https://github.com/OpenAsar/arrpc</ref>:


{{file|configuration.nix|nix|3=
{ pkgs, ... }: {
  enviroment.systemPackages = with pkgs; [
    arrpc
  ];
  systemd.packages = with pkgs; [
    arrpc
  ];
}
}}
Or add the following to your Home Manager configuration:
{{file|home.nix|nix|3=
{ pkgs, ... }: {
  services.arrpc = {
    enable = true;
    package = pkgs.arrpc; # Default
    systemdTarget = "graphical-session.target"; # Default
  };
}
}}


[[Category:Applications]]
[[Category:Applications]]
[[Category:Gaming]]

Latest revision as of 00:11, 20 November 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

Official Clients

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

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

❄︎ configuration.nix
{ pkgs, ... }: {
  # This installs Discord only for the user "alice"
  users.users.alice.packages = with pkgs; [
    discord
  ];

  # This will install Discord PTB for all users of the system
  environment.systemPackages = with pkgs; [
    discord-ptb
  ];
}

Unofficial Clients

⚠︎
Warning: Use of unofficial clients goes against Discord's TOS and possesses the risk of permanently suspending your account from the platform!

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 legcord.

GoofCord[2] is a security oriented fork of Legcord. Provided via goofcord.

BetterDiscord[3] enhances Discord desktop app with new features. Installer provided via 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[4] is an open-source alternative to Discord's app.asar. Provided via openasar without usable client. Users should instead prefer to override the official discord package and add withOpenASAR = true:

(discord.override {
  withOpenASAR = true;
  #withVencord = true; # complementary
})

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

(discord.override {
  #withOpenASAR = true; # complementary
  withVencord = true;
})

Vesktop[6] is a customizable and privacy friendly desktop app by the developers of Discord's cutest client mod. Provided via vesktop. Can be configured in Home Manager:

❄︎ home.nix
{ ... }: {
  programs.vesktop = {
    enable = true;

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

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

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

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

Dissent[9] is a simple, practical Discord client prioritizing speed over feature completeness. Provided via dissent.

Discordo[10] is a TUI Discord client provided via discordo. Development in progress, possible crashes and breaking changes.

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

Ripcord[12] is an unfree client for Discord and Slack with a traditional compact interface for power users. Provided via ripcord.

Troubleshooting

Wayland screen sharing

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!

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 dunst and mako. You may optionally use a notification daemon from a larger DE, such as lxqt.lxqt-notificationd, however it is unclear how effective these will be outside of their normal environment.

❄︎ configuration.nix
{ 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
  ];
}

Start-up crash

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"

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 and related issues for details. This was fixed in the unstable channel of nixpkgs on August 10, 2026 (PR: https://github.com/NixOS/nixpkgs/pull/544831).

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[13]:

❄︎ 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
  };
}