Skip to content

Commit

Permalink
Merge branch 'master' into docs-split-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
danth authored Feb 18, 2025
2 parents c1fead0 + 9343b66 commit 56183d3
Show file tree
Hide file tree
Showing 10 changed files with 191 additions and 152 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.

56 changes: 35 additions & 21 deletions modules/qt/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,39 @@ in
};
};

config = lib.mkIf (config.stylix.enable && config.stylix.targets.qt.enable) {
stylix.targets.qt.platform =
with config.services.xserver.desktopManager;
if gnome.enable && !(plasma5.enable || lxqt.enable) then
lib.mkDefault "gnome"
else if plasma5.enable && !(gnome.enable || lxqt.enable) then
lib.mkDefault "kde"
else if lxqt.enable && !(gnome.enable || plasma5.enable) then
lib.mkDefault "lxqt"
else
lib.mkDefault "qtct";
qt = {
enable = true;
style = recommendedStyle."${config.qt.platformTheme}" or null;
platformTheme =
if config.stylix.targets.qt.platform == "qtct" then
"qt5ct"
else
config.stylix.targets.qt.platform;
};
};
config =
let
broken = config.services.desktopManager.plasma6.enable;
warning = {
warnings = [
"stylix: qt: Plasma6 is currently unsupported: https://github.com/nix-community/home-manager/issues/5098"
];
};
default = lib.mkIf (config.stylix.enable && config.stylix.targets.qt.enable) {

stylix.targets.qt.platform =
with config.services.xserver.desktopManager;
if gnome.enable && !(plasma5.enable || lxqt.enable) then
"gnome"
else if plasma5.enable && !(gnome.enable || lxqt.enable) then
"kde"
else if lxqt.enable && !(gnome.enable || plasma5.enable) then
"lxqt"
else
"qtct";
qt = {
enable = true;
style = recommendedStyle."${config.qt.platformTheme}" or null;
platformTheme =
if config.stylix.targets.qt.platform == "qtct" then
"qt5ct"
else
config.stylix.targets.qt.platform;
};
};
in
lib.mkMerge [
(lib.mkIf broken warning)
(lib.mkIf (!broken) default)
];
}
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.

6 changes: 3 additions & 3 deletions stylix/palette.json.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"base0D": "{{{base0D}}}",
"base0E": "{{{base0E}}}",
"base0F": "{{{base0F}}}",
"scheme": "Stylix",
"author": "Stylix",
"slug": "stylix"
"author": "{{author}}",
"scheme": "{{scheme}}",
"slug": "{{slug}}"
}
Loading

0 comments on commit 56183d3

Please sign in to comment.