style: setup qt and gtk styles, options and defaults
This commit is contained in:
parent
c259ae1c56
commit
b7da4a442b
4 changed files with 97 additions and 43 deletions
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
theme = {
|
||||||
|
package = pkgs.gruvbox-gtk-theme;
|
||||||
|
name = "Gruvbox-Dark-BL";
|
||||||
|
};
|
||||||
|
cfg = config.modules.theming.qt;
|
||||||
|
inherit (config.modules.other.system) username;
|
||||||
|
in {
|
||||||
|
options.modules.theming.qt = {
|
||||||
|
enable = mkEnableOption "qt theming";
|
||||||
|
name = mkOption {
|
||||||
|
description = "qt theme name";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
variant = mkOption {
|
||||||
|
description = "qt theme variant";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
accentColor = mkOption {
|
||||||
|
description = "accent colour for qt theme";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
package = mkOption {
|
||||||
|
description = "qt theme package";
|
||||||
|
type = types.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.sessionVariables = {QT_QPA_PLATFORMTHEME = "qt5ct";};
|
||||||
|
environment.variables = {
|
||||||
|
QT_STYLE_OVERRIDE = lib.mkForce "kvantum";
|
||||||
|
GTK_THEME = theme.name;
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.${username} = {
|
||||||
|
qt = {
|
||||||
|
enable = true;
|
||||||
|
# style = {
|
||||||
|
# inherit (cfg) name package;
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
home = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
qt5.qttools
|
||||||
|
libsForQt5.qt5ct
|
||||||
|
libsForQt5.qtstyleplugin-kvantum
|
||||||
|
breeze-icons
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -20,4 +20,13 @@ in {
|
||||||
corefonts
|
corefonts
|
||||||
]
|
]
|
||||||
++ optional (extraFonts != null) extraFonts;
|
++ optional (extraFonts != null) extraFonts;
|
||||||
|
# this fixes emoji stuff
|
||||||
|
fontconfig = {
|
||||||
|
defaultFonts = {
|
||||||
|
monospace = ["ComicShannsMono Nerd Font" "Noto Color Emoji"];
|
||||||
|
sansSerif = ["ComicShannsMono Nerd Font" "Noto Color Emoji"];
|
||||||
|
serif = ["ComicShannsMono Nerd Font" "Noto Color Emoji"];
|
||||||
|
emoji = ["Noto Color Emoji"];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,50 +9,54 @@ with lib; let
|
||||||
package = pkgs.gruvbox-gtk-theme;
|
package = pkgs.gruvbox-gtk-theme;
|
||||||
name = "Gruvbox-Dark-BL";
|
name = "Gruvbox-Dark-BL";
|
||||||
};
|
};
|
||||||
cfg = config.modules.theming.qt;
|
cfg = config.modules.style.qt;
|
||||||
inherit (config.modules.other.system) username;
|
inherit (config.modules.other.system) username;
|
||||||
in {
|
in {
|
||||||
options.modules.theming.qt = {
|
|
||||||
enable = mkEnableOption "qt theming";
|
|
||||||
name = mkOption {
|
|
||||||
description = "qt theme name";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
variant = mkOption {
|
|
||||||
description = "qt theme variant";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
accentColour = mkOption {
|
|
||||||
description = "accent colour for qt theme";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
package = mkOption {
|
|
||||||
description = "qt theme package";
|
|
||||||
type = types.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.sessionVariables = {QT_QPA_PLATFORMTHEME = "qt5ct";};
|
environment.sessionVariables = {QT_QPA_PLATFORMTHEME = "qt5ct";};
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
QT_STYLE_OVERRIDE = lib.mkForce "kvantum";
|
QT_STYLE_OVERRIDE = lib.mkForce "kvantum";
|
||||||
GTK_THEME = theme.name;
|
GTK_THEME = theme.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${username} = {
|
home-manager.users.${username} = {
|
||||||
|
# This is taken from jacekpoz, thanks a lot!
|
||||||
qt = {
|
qt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# style = {
|
style = {
|
||||||
# inherit (cfg) name package;
|
inherit (cfg) name;
|
||||||
# };
|
package = cfg.package.override {
|
||||||
|
flavour = [cfg.variant];
|
||||||
|
accents = [cfg.accentColor];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
qt5.qttools
|
qt5.qttools
|
||||||
libsForQt5.qt5ct
|
qt6Packages.qtstyleplugin-kvantum
|
||||||
libsForQt5.qtstyleplugin-kvantum
|
libsForQt5.qtstyleplugin-kvantum
|
||||||
|
libsForQt5.qt5ct
|
||||||
breeze-icons
|
breeze-icons
|
||||||
];
|
];
|
||||||
|
|
||||||
|
sessionVariables = {
|
||||||
|
# Scaling factor for QT applications
|
||||||
|
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||||
|
|
||||||
|
# Use wayland as the default backend, fall back to xcb if not available
|
||||||
|
QT_QPA_PLATFORM = "wayland;xcb";
|
||||||
|
|
||||||
|
# Disable window decorations for qt applications
|
||||||
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||||
|
|
||||||
|
# Remain compatible with QT5 whenever possible
|
||||||
|
DISABLE_QT_COMPAT = "0";
|
||||||
|
|
||||||
|
# Tell Calibre to use the dark theme, because the light one hurts my eyes.
|
||||||
|
CALIBRE_USE_DARK_PALETTE = "1";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,25 +48,7 @@ in {
|
||||||
# package = pkgs.bibata-cursors;
|
# package = pkgs.bibata-cursors;
|
||||||
# name = "Bibata-Modern-Classic";
|
# name = "Bibata-Modern-Classic";
|
||||||
};
|
};
|
||||||
fonts = {
|
|
||||||
sizes = {
|
|
||||||
inherit (fontsizes) terminal popups applications;
|
|
||||||
};
|
|
||||||
monospace = {
|
|
||||||
package =
|
|
||||||
pkgs.nerdfonts.override {fonts = ["JetBrainsMono" "ComicShannsMono"];};
|
|
||||||
# name = "JetBrainsMono";
|
|
||||||
name = "ComicShannsMono Nerd Font";
|
|
||||||
};
|
|
||||||
|
|
||||||
serif = config.stylix.fonts.monospace;
|
|
||||||
sansSerif = config.stylix.fonts.monospace;
|
|
||||||
|
|
||||||
emoji = {
|
|
||||||
package = pkgs.noto-fonts-color-emoji;
|
|
||||||
name = "Noto Color Emoji";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
opacity = {
|
opacity = {
|
||||||
applications = 1.0;
|
applications = 1.0;
|
||||||
popups = 1.0;
|
popups = 1.0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue