Use a more customized Discord package

This commit is contained in:
Natsu Kagami 2022-11-08 18:59:53 +01:00
parent 6a14d9d7ad
commit 8e49a68efb
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
4 changed files with 34 additions and 2 deletions

View file

@ -3,6 +3,7 @@ with lib; {
imports = [ imports = [
./modules/linux/graphical ./modules/linux/graphical
./modules/X11/xfce4-notifyd.nix ./modules/X11/xfce4-notifyd.nix
./modules/programs/discord.nix
]; ];
config = (mkIf pkgs.stdenv.isLinux { config = (mkIf pkgs.stdenv.isLinux {
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -16,6 +17,9 @@ with lib; {
vivaldi vivaldi
mpv # for anki mpv # for anki
pkgs.unstable.anki-bin pkgs.unstable.anki-bin
tdesktop
whatsapp-for-linux
] ]
else [ ] else [ ]
); );

View file

@ -37,10 +37,11 @@ in
xdg-utils # Open stuff xdg-utils # Open stuff
] ++ (if pkgs.stdenv.isAarch64 then [ ] else [ ] ++ (if pkgs.stdenv.isAarch64 then [ ] else [
mailspring mailspring
unstable.discord
unstable.slack unstable.slack
])); ]));
nki.programs.discord.enable = pkgs.stdenv.isx86_64;
# Cursor # Cursor
home.pointerCursor = { home.pointerCursor = {
package = pkgs.numix-cursor-theme; package = pkgs.numix-cursor-theme;

View file

@ -0,0 +1,27 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.nki.programs.discord;
in
{
options.nki.programs.discord = {
enable = mkEnableOption "Enable discord";
basePackage = mkOption {
type = types.package;
default = pkgs.unstable.discord;
description = "The base Discord package that will get patched";
};
package = mkOption {
type = types.package;
default = cfg.basePackage.override { withOpenASAR = true; nss = pkgs.nss_latest; };
description = "The actual package to use";
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
};
}

View file

@ -71,7 +71,7 @@ in
discord = mkOption { discord = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
description = "The command for discord"; description = "The command for discord";
default = "${pkgs.discord}/bin/discord"; default = "${config.nki.programs.discord.package}/bin/discord";
}; };
lockCmd = mkOption { lockCmd = mkOption {