From a264a86d935fae69558f363881d65a19a4f4d735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo?= Date: Tue, 5 Jul 2022 10:32:11 -0300 Subject: [PATCH 1/3] nixos/qt5: add qt5ct as a possible platform theme --- nixos/modules/config/qt5.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nixos/modules/config/qt5.nix b/nixos/modules/config/qt5.nix index eabba9ad95f0..f0ea6825db10 100644 --- a/nixos/modules/config/qt5.nix +++ b/nixos/modules/config/qt5.nix @@ -8,9 +8,11 @@ let isQGnome = cfg.platformTheme == "gnome" && builtins.elem cfg.style ["adwaita" "adwaita-dark"]; isQtStyle = cfg.platformTheme == "gtk2" && !(builtins.elem cfg.style ["adwaita" "adwaita-dark"]); + isQt5ct = cfg.platformTheme == "qt5ct"; packages = if isQGnome then [ pkgs.qgnomeplatform pkgs.adwaita-qt ] else if isQtStyle then [ pkgs.libsForQt5.qtstyleplugins ] + else if isQt5ct then [ pkgs.libsForQt5.qt5ct ] else throw "`qt5.platformTheme` ${cfg.platformTheme} and `qt5.style` ${cfg.style} are not compatible."; in @@ -26,11 +28,13 @@ in type = types.enum [ "gtk2" "gnome" + "qt5ct" ]; example = "gnome"; relatedPackages = [ "qgnomeplatform" ["libsForQt5" "qtstyleplugins"] + ["libsForQt5" "qt5ct"] ]; description = '' Selects the platform theme to use for Qt5 applications. @@ -48,6 +52,13 @@ in qgnomeplatform + + qt5ct + Use Qt style set using the + qt5ct + application. + + ''; }; @@ -96,7 +107,7 @@ in environment.variables.QT_QPA_PLATFORMTHEME = cfg.platformTheme; - environment.variables.QT_STYLE_OVERRIDE = cfg.style; + environment.variables.QT_STYLE_OVERRIDE = mkIf (! isQt5ct) cfg.style; environment.systemPackages = packages; From 47ba8cdcc7096242bd98f9d9631fa9dd4974cf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo?= Date: Tue, 5 Jul 2022 13:33:37 -0300 Subject: [PATCH 2/3] nixos/qt5: add maintainer --- nixos/modules/config/qt5.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/config/qt5.nix b/nixos/modules/config/qt5.nix index f0ea6825db10..542a96ba6b06 100644 --- a/nixos/modules/config/qt5.nix +++ b/nixos/modules/config/qt5.nix @@ -18,6 +18,7 @@ let in { + meta.maintainers = [ maintainers.romildo ]; options = { qt5 = { From 68cc57cce147e52f382802c8b257c8f319aac173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo?= Date: Tue, 5 Jul 2022 10:32:54 -0300 Subject: [PATCH 3/3] nixos/qt5ct: remove enable option and suggests qt5.platformTheme This module should be removed after a nixos release cycle --- nixos/modules/programs/qt5ct.nix | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/nixos/modules/programs/qt5ct.nix b/nixos/modules/programs/qt5ct.nix index 88e861bf4031..3ff47b355915 100644 --- a/nixos/modules/programs/qt5ct.nix +++ b/nixos/modules/programs/qt5ct.nix @@ -1,31 +1,9 @@ -{ config, lib, pkgs, ... }: +{ lib, ... }: with lib; { - meta.maintainers = [ maintainers.romildo ]; - - ###### interface - options = { - programs.qt5ct = { - enable = mkOption { - default = false; - type = types.bool; - description = '' - Whether to enable the Qt5 Configuration Tool (qt5ct), a - program that allows users to configure Qt5 settings (theme, - font, icons, etc.) under desktop environments or window - manager without Qt integration. - - Official home page: https://sourceforge.net/projects/qt5ct/ - ''; - }; - }; - }; - - ###### implementation - config = mkIf config.programs.qt5ct.enable { - environment.variables.QT_QPA_PLATFORMTHEME = "qt5ct"; - environment.systemPackages = with pkgs; [ libsForQt5.qt5ct ]; - }; + imports = [ + (mkRemovedOptionModule [ "programs" "qt5ct" "enable" ] "Use qt5.platformTheme = \"qt5ct\" instead.") + ]; }