diff --git a/modules/options/style/qt.nix b/modules/options/style/qt.nix index e69de29..1c60539 100644 --- a/modules/options/style/qt.nix +++ b/modules/options/style/qt.nix @@ -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 + ]; + }; + }; + }; +} diff --git a/modules/style/fonts.nix b/modules/style/fonts.nix index 8d1421b..870d79a 100644 --- a/modules/style/fonts.nix +++ b/modules/style/fonts.nix @@ -20,4 +20,13 @@ in { corefonts ] ++ 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"]; + }; + }; } diff --git a/modules/style/qt.nix b/modules/style/qt.nix index aae2be1..de05a9f 100644 --- a/modules/style/qt.nix +++ b/modules/style/qt.nix @@ -9,50 +9,54 @@ with lib; let package = pkgs.gruvbox-gtk-theme; name = "Gruvbox-Dark-BL"; }; - cfg = config.modules.theming.qt; + cfg = config.modules.style.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; - }; - accentColour = 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} = { + # This is taken from jacekpoz, thanks a lot! qt = { enable = true; - # style = { - # inherit (cfg) name package; - # }; + style = { + inherit (cfg) name; + package = cfg.package.override { + flavour = [cfg.variant]; + accents = [cfg.accentColor]; + }; + }; }; home = { packages = with pkgs; [ qt5.qttools - libsForQt5.qt5ct + qt6Packages.qtstyleplugin-kvantum libsForQt5.qtstyleplugin-kvantum + libsForQt5.qt5ct 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"; + }; }; }; }; diff --git a/modules/style/stylix.nix b/modules/style/stylix.nix index 21a3b1c..ca7be63 100644 --- a/modules/style/stylix.nix +++ b/modules/style/stylix.nix @@ -48,25 +48,7 @@ in { # package = pkgs.bibata-cursors; # 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 = { applications = 1.0; popups = 1.0;