Discord: Difference between revisions
imported>Garbas mNo edit summary |
imported>Artturin replace nix-env |
||
Line 1: | Line 1: | ||
{{unfree}} | {{unfree}} | ||
== | == 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"> | |||
nixpkgs.config = { | |||
allowUnfree = true; | |||
}; | |||
environment.systemPackages = with pkgs; [ discord ] | |||
</syntaxhighlight> | |||
=== Home Manager === | |||
Can be used on both NixOS and non-NixOS | |||
</ | Same as above but replace <code>environment.systemPackages</code> with <code>home.packages</code> | ||
=== Non-NixOS === | |||
[https://nixos.org/manual/nixpkgs/stable/#sec-declarative-package-management declarative package management on non-nixos] | |||
== Usage == | == Usage == |
Revision as of 09:11, 14 November 2020
Installation
available builds
discord discord-ptb discord-canary
replace the discord
below with whichever build you want
NixOS
nixpkgs.config = {
allowUnfree = true;
};
environment.systemPackages = with pkgs; [ discord ]
Home Manager
Can be used on both NixOS and non-NixOS
Same as above but replace environment.systemPackages
with home.packages
Non-NixOS
declarative package management on non-nixos
Usage
Command Line:
$ Discord
The nix expression also installs a desktop item as another option for starting the application.
Join the NixOS Discord
Follow this link to join the unofficial NixOS Discord: https://discord.com/invite/RbvHtGa
Opening Links with Firefox
If you use Discord and it silently fails to open links in Firefox, you possibly have encountered 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
$ nix path-info $(which firefox) -r | grep nss-
This should print a few store paths, focus on their ends, which should look like nss-x.xx
. We're interested in the one with the newest version. Next, create a new file called discord_patched.nix
and paste the following code into it:
with import <nixpkgs> {};
pkgs.discord.override {
nss = pkgs.nss_3_49_2;
}
Now replace nss_3_49_2
with the previously looked up version's "attribute name", which you can look up here. Finally, build and install this patched package with
$ nix-env -i $(nix build discord_patched.nix) --arg config '{ allowUnfree = true; }'
Log in again and you should be able to open links properly.