diff --git a/home/common-linux.nix b/home/common-linux.nix index 3861256..d0e59fc 100644 --- a/home/common-linux.nix +++ b/home/common-linux.nix @@ -3,6 +3,7 @@ with lib; { imports = [ ./modules/linux/graphical ./modules/X11/xfce4-notifyd.nix + ./modules/programs/discord.nix ]; config = (mkIf pkgs.stdenv.isLinux { home.packages = with pkgs; [ @@ -16,6 +17,9 @@ with lib; { vivaldi mpv # for anki pkgs.unstable.anki-bin + + tdesktop + whatsapp-for-linux ] else [ ] ); diff --git a/home/modules/linux/graphical/default.nix b/home/modules/linux/graphical/default.nix index aee9de8..41445af 100644 --- a/home/modules/linux/graphical/default.nix +++ b/home/modules/linux/graphical/default.nix @@ -37,10 +37,11 @@ in xdg-utils # Open stuff ] ++ (if pkgs.stdenv.isAarch64 then [ ] else [ mailspring - unstable.discord unstable.slack ])); + nki.programs.discord.enable = pkgs.stdenv.isx86_64; + # Cursor home.pointerCursor = { package = pkgs.numix-cursor-theme; diff --git a/home/modules/programs/discord.nix b/home/modules/programs/discord.nix new file mode 100644 index 0000000..3a22d8b --- /dev/null +++ b/home/modules/programs/discord.nix @@ -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 ]; + }; +} diff --git a/home/modules/programs/my-sway/default.nix b/home/modules/programs/my-sway/default.nix index 245abfe..1063d7e 100644 --- a/home/modules/programs/my-sway/default.nix +++ b/home/modules/programs/my-sway/default.nix @@ -71,7 +71,7 @@ in discord = mkOption { type = types.nullOr types.str; description = "The command for discord"; - default = "${pkgs.discord}/bin/discord"; + default = "${config.nki.programs.discord.package}/bin/discord"; }; lockCmd = mkOption {