Skip to content

Commit

Permalink
discord: combine nixcord, vencord, and vesktop modules (#854)
Browse files Browse the repository at this point in the history
Link: #854

Reviewed-by: Daniel Thwaites <[email protected]>
Reviewed-by: NAHO <[email protected]>
  • Loading branch information
Flameopathic authored Feb 17, 2025
1 parent 21d68da commit 7feb1c2
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 93 deletions.
67 changes: 67 additions & 0 deletions modules/discord/hm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
config,
lib,
pkgs,
options,
...
}:
let
template =
let
inherit (config.lib.stylix) colors;
inherit (config.stylix) fonts;
in
import ./template.nix { inherit colors fonts; };
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 config.stylix.enable (
lib.mkMerge [
(lib.mkIf config.stylix.targets.vencord.enable {
xdg.configFile."Vencord/themes/stylix.theme.css".text = template;
})

(lib.mkIf config.stylix.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.stylix.targets.nixcord.enable (
lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) {
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.
21 changes: 21 additions & 0 deletions modules/discord/testbeds/vencord.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ lib, pkgs, ... }:

let
package = pkgs.discord.override {
withVencord = true;
};
in
{
stylix.testbed.application = {
enable = true;
name = "discord";
inherit package;
};

environment.systemPackages = [ package ];
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"discord"
];
}
14 changes: 14 additions & 0 deletions modules/discord/testbeds/vesktop.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ pkgs, ... }:

let
package = pkgs.vesktop;
in
{
stylix.testbed.application = {
enable = true;
name = "vesktop";
inherit package;
};

environment.systemPackages = [ package ];
}
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.

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

This file was deleted.

0 comments on commit 7feb1c2

Please sign in to comment.