Installing BetterDiscord with nixpkgs and not flakes or HM

My goal is to install BetterDiscord so I can use custom CSS themes.

On their official website, BetterDiscord is distributed as an AppImage which is not the usual way NixOS users deploy packages.

According to the official NixOS Wiki, BetterDiscord can be installed in this way:

$ 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

Here is the output of all four of those commands:

$ nix-shell -p betterdiscordctl --command 'betterdiscordctl install'  
error: filesystem error: status: Permission denied [/home/Paul/.nix-defexpr/channels]
$ nix run nixpkgs#betterdiscordctl -- install
zsh: no matches found: nixpkgs#betterdiscordctl
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl self-upgrade'
error: filesystem error: status: Permission denied [/home/Paul/.nix-defexpr/channels]
$ nix run nixpkgs#betterdiscordctl -- self-upgrade
zsh: no matches found: nixpkgs#betterdiscordctl
$

All error messages.

I have betterdiscordctl included in the list of packages in my configuration.nix.

I am not using flakes or home-manager and am enrolled in the unstable channel.

If the official Wiki is out of date and someone here can provide insight, I would be happy to update the Wiki.

There are many better options than BetterDiscord nowadays. If you aren’t completely set on using it for some specific reason, I’d recommend just using Moonlight, Vencord, or Equicord, all of which support custom CSS. They can also all be very easily enabled on Discord from Nixpkgs with an override.

Here’s an example if you need: modules/programs/gui.nix at main Ā· @belsanti.xyz/nixconfig Ā· tangled

Line 24 is the only one you’d need, the others are optional.

1 Like

ā€œzsh: no matches foundā€ smells like a shell quotation problem, nothing to do with Nix per se. Try this variation instead:

nix run 'nixpkgs#betterdiscordctl' -- install

This may well produce the same ā€œPermission deniedā€ error as some of the other commands, and I can’t help with that part.

The # in the command is causing it. This should only happens if 'extended_glob` is enabled. Some info here: šŸƒ Expansion | Z-Shell

You can also prefix the command with noglob to do this. When I last used Zsh I used an alias for this.

The reason why I am interested in BetterDiscord is because it is the only client Catppuccin themes are compatible with. On the official Catppuccin Ports lookup website, I searched for Moonlight, Vencord, Equicord of which none are support as yet. BetterDiscord is the only option for now I guess.

This worked perfectly! No more wrangling. Thanks @zwol! I have a gorgeous Catppuccin themed Discord client. :slight_smile:

Glad you got it working!

Btw, the custom CSS method would work on any modded Discord client.

Either way, whatever works works!