diff --git a/modules/discord/hm.nix b/modules/discord/hm.nix index 96eb5d82..0e68eeb5 100644 --- a/modules/discord/hm.nix +++ b/modules/discord/hm.nix @@ -1,7 +1,6 @@ { config, lib, - pkgs, options, ... }: @@ -12,21 +11,29 @@ let }; in { - options.stylix.targets = - lib.mapAttrs - (_: prettyName: { - enable = config.lib.stylix.mkEnableTarget prettyName true; - extraCss = lib.mkOption { - description = "Extra CSS to added to ${prettyName}'s theme"; - type = lib.types.lines; - default = ""; - }; - }) - { - vencord = "Vencord"; - vesktop = "Vesktop"; - nixcord = "Nixcord"; + imports = lib.singleton ( + lib.mkRemovedOptionModule [ "stylix" "targets" "vesktop" "extraCss" ] + "CSS can be added to by declaring 'programs.vesktop.vencord.themes.stylix = lib.mkAfter \"YOUR EXTRA CSS\";" + ); + options.stylix.targets = { + vesktop.enable = config.lib.stylix.mkEnableTarget "Vesktop" true; + vencord = { + enable = config.lib.stylix.mkEnableTarget "Vencord" true; + extraCss = lib.mkOption { + description = "Extra CSS to added to Vencord's theme"; + type = lib.types.lines; + default = ""; }; + }; + nixcord = { + enable = config.lib.stylix.mkEnableTarget "Nixcord" true; + extraCss = lib.mkOption { + description = "Extra CSS to added to Nixcord's theme"; + type = lib.types.lines; + default = ""; + }; + }; + }; config = lib.mkIf config.stylix.enable ( lib.mkMerge [ @@ -35,19 +42,12 @@ in template + config.stylix.targets.vencord.extraCss; }) - (lib.mkIf config.stylix.targets.vesktop.enable ( - lib.mkMerge [ - (lib.mkIf pkgs.stdenv.hostPlatform.isLinux { - xdg.configFile."vesktop/themes/stylix.theme.css".text = - template + config.stylix.targets.vesktop.extraCss; - }) - - (lib.mkIf pkgs.stdenv.hostPlatform.isDarwin { - home.file."Library/Application Support/vesktop/themes/stylix.theme.css".text = - template + config.stylix.targets.vesktop.extraCss; - }) - ] - )) + (lib.mkIf config.stylix.targets.vesktop.enable { + programs.vesktop.vencord = { + themes.stylix = template; + settings.enabledThemes = [ "stylix.css" ]; + }; + }) (lib.mkIf config.stylix.targets.nixcord.enable ( lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) { diff --git a/modules/discord/testbeds/vesktop.nix b/modules/discord/testbeds/vesktop.nix index d4588fa8..9c6f2d64 100644 --- a/modules/discord/testbeds/vesktop.nix +++ b/modules/discord/testbeds/vesktop.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: let package = pkgs.vesktop; @@ -10,5 +10,10 @@ in inherit package; }; - environment.systemPackages = [ package ]; + home-manager.sharedModules = lib.singleton { + programs.vesktop = { + enable = true; + inherit package; + }; + }; }