Skip to content

Commit

Permalink
discord: combine nixcord, vencord, vesktop
Browse files Browse the repository at this point in the history
  • Loading branch information
Flameopathic committed Feb 11, 2025
1 parent 4af2686 commit e6d3fd8
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 114 deletions.
68 changes: 68 additions & 0 deletions modules/discord/hm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
config,
lib,
pkgs,
options,
...
}:
let
template =
let
inherit (config.lib.stylix) colors;
inherit (config.stylix) fonts;
in
import ./template.nix { inherit colors fonts; };
cfg = config.stylix;
in
{
options.stylix.targets =
let
inherit (config.lib.stylix) mkEnableTarget;
in
{
vencord.enable = mkEnableTarget "Vencord" true;
vesktop.enable = mkEnableTarget "Vesktop" true;
nixcord.enable = mkEnableTarget "Nixcord" true;
};

config = lib.mkIf cfg.enable (
lib.mkMerge [
(lib.mkIf cfg.targets.vencord.enable {
xdg.configFile."Vencord/themes/stylix.theme.css".text = template;
})

(lib.mkIf cfg.targets.vesktop.enable (
lib.mkMerge [
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
xdg.configFile."vesktop/themes/stylix.theme.css".text = template;
})

(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
home.file."Library/Application Support/vesktop/themes/stylix.theme.css".text =
template;
})
]
))

(lib.mkIf ((config.programs ? nixcord) && cfg.targets.nixcord.enable) (
lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) {
# possible the above `hasAttr` condition is unnecessary because of the `config.programs ? nixcord` condition
xdg.configFile =
let
inherit (config.programs) nixcord;
in
lib.mkMerge [
(lib.mkIf nixcord.discord.enable {
"Vencord/themes/stylix.theme.css".text = template;
})

(lib.mkIf nixcord.vesktop.enable {
"vesktop/themes/stylix.theme.css".text = template;
})
];
programs.nixcord.config.enabledThemes = [ "stylix.theme.css" ];
}
))
]
);
}
File renamed without changes.
File renamed without changes.
41 changes: 0 additions & 41 deletions modules/nixcord/hm.nix

This file was deleted.

19 changes: 0 additions & 19 deletions modules/vencord/hm.nix

This file was deleted.

21 changes: 0 additions & 21 deletions modules/vencord/testbed.nix

This file was deleted.

33 changes: 0 additions & 33 deletions modules/vesktop/hm.nix

This file was deleted.

0 comments on commit e6d3fd8

Please sign in to comment.