Discord: Difference between revisions

Frontear (talk | contribs)
reformat a large chunk of this page to improve formatting
Frontear (talk | contribs)
improve the troubleshooting format
Line 36: Line 36:
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="bash">
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="bash">
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl install' # nix-legacy
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl install' # nix-legacy
$ nix run nixpkgs#betterdiscordctl -- install # nix3-cli
$ nix run nixpkgs#betterdiscordctl -- install # nix3


$ nix-shell -p betterdiscordctl --command 'betterdiscordctl self-upgrade' # nix-legacy
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl self-upgrade' # nix-legacy
$ nix run nixpkgs#betterdiscordctl -- self-upgrade # nix3-cli
$ nix run nixpkgs#betterdiscordctl -- self-upgrade # nix3
</syntaxhighlight>
</syntaxhighlight>


Line 102: Line 102:
<nowiki>}</nowiki>
<nowiki>}</nowiki>
}}
}}
=== Opening Links with Firefox ===
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">
with import <nixpkgs> {};
pkgs.discord.override {
    nss = pkgs.nss_3_49_2;
}
</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
<syntaxhighlight lang="console">
$ export NIXPKGS_ALLOW_UNFREE=1; nix-env -i $(nix-build discord_patched.nix) --arg config '{ allowUnfree = true; }'
</syntaxhighlight>
Log in again and you should be able to open links properly.


=== Krisp noise suppression ===
=== Krisp noise suppression ===
Line 135: Line 111:
(pkgs.discord.override { withTTS = true; })
(pkgs.discord.override { withTTS = true; })
</syntaxhighlight>
</syntaxhighlight>
== Links ==
[https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/instant-messengers/discord/default.nix default.nix for discord]
[[Category:Applications]]
[[Category:Applications]]
[[Category:Gaming]]
[[Category:Gaming]]