Files
chiasson-nix/modules/wisdom/desktop/gtk-qt-theming.nix
T
Olivier 17337b9675 Add DMS configuration enhancements and new default settings
- Introduced a new private default settings file for Dank Material Shell (DMS) to manage user-specific settings.
- Updated DMS home-manager module to generate a settings seed file, merging extra right-bar widgets into the first-run configuration.
- Added support for dynamic inclusion of DMS window rules based on user configuration.
- Enhanced the Niri configuration with a preference for no client-side decorations and improved keybindings for bar toggling.
2026-06-20 21:20:00 -03:00

141 lines
4.1 KiB
Nix

{ ... }: {
flake.homeManagerModules.wisdomDesktopGtkQtTheming =
{ config, lib, pkgs, osConfig ? { }, ... }:
let
root = config.chiasson.home;
cfg = config.chiasson.home.desktop.theming;
dmsShell = (lib.attrByPath [ "chiasson" "desktop" "shell" ] null osConfig) == "dms";
qtPlatformTheme = if dmsShell then "qt6ct" else cfg.qt.platformTheme;
in
{
options.chiasson.home.desktop.theming = {
enable = lib.mkEnableOption ''
WhiteSur GTK + icon themes, Phinger cursor, and Qt via qt6ct (DMS) or KDE platform theme.
Matugen accent colors load via gtk3/gtk4 extraCss when matugenGtkColors is enabled.
'';
matugenGtkColors = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Add `@import url("dank-colors.css");` to gtk3/gtk4 extraCss (DMS matugen writes the file).
'';
};
gtkTheme = {
name = lib.mkOption {
type = lib.types.str;
default = "WhiteSur-Dark";
};
package = lib.mkOption {
type = lib.types.package;
default = pkgs.whitesur-gtk-theme;
};
};
iconTheme = {
name = lib.mkOption {
type = lib.types.str;
default = "WhiteSur-dark";
};
package = lib.mkOption {
type = lib.types.package;
default = pkgs.whitesur-icon-theme;
};
};
cursor = {
name = lib.mkOption {
type = lib.types.str;
default = "phinger-cursors-dark";
};
package = lib.mkOption {
type = lib.types.package;
default = pkgs.phinger-cursors;
};
size = lib.mkOption {
type = lib.types.int;
default = 32;
};
};
qt = {
platformTheme = lib.mkOption {
type = lib.types.str;
default = "kde";
description = ''
`QT_QPA_PLATFORMTHEME` when not using DMS shell. DMS hosts use qt6ct automatically.
'';
};
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ pkgs.kdePackages.qt6ct ];
description = "Qt platform integration packages.";
};
};
};
config = lib.mkIf (root.enable && cfg.enable) (lib.mkMerge [
{
home.packages =
if dmsShell then
[ pkgs.kdePackages.qt6ct ]
else
cfg.qt.extraPackages;
home.sessionVariables = {
QT_QPA_PLATFORMTHEME = qtPlatformTheme;
}
// lib.optionalAttrs (qtPlatformTheme == "qt6ct") {
QT_QPA_PLATFORMTHEME_QT6 = "qt6ct";
};
home.pointerCursor = {
name = cfg.cursor.name;
package = cfg.cursor.package;
size = cfg.cursor.size;
gtk.enable = true;
x11.enable = true;
};
gtk = {
enable = true;
theme = {
name = cfg.gtkTheme.name;
package = cfg.gtkTheme.package;
};
iconTheme = {
name = cfg.iconTheme.name;
package = cfg.iconTheme.package;
};
cursorTheme = {
name = cfg.cursor.name;
package = cfg.cursor.package;
size = cfg.cursor.size;
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
gtk4 = {
theme = {
name = cfg.gtkTheme.name;
package = cfg.gtkTheme.package;
};
extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
};
}
(lib.mkIf cfg.matugenGtkColors {
gtk.gtk3.extraCss = ''
@import url("dank-colors.css");
'';
gtk.gtk4.extraCss = ''
@import url("dank-colors.css");
'';
})
]);
};
}