vesktop: use upstream options (#1150)

Link: https://github.com/danth/stylix/pull/1150

Co-authored-by: awwpotato <awwpotato@voidq.com>
Reviewed-by: awwpotato <awwpotato@voidq.com>
This commit is contained in:
Flameopathic 2025-04-24 20:46:00 -04:00 committed by GitHub
parent 2177469520
commit 4846adbc2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 30 deletions

View file

@ -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) {

View file

@ -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;
};
};
}