From 956c60eda8408b9aff735afdcdeb16b21a27b480 Mon Sep 17 00:00:00 2001 From: gnidorah Date: Mon, 14 Oct 2019 20:45:39 +0300 Subject: [PATCH] nixos/qt: support theming qt4 --- nixos/modules/config/qt.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/nixos/modules/config/qt.nix b/nixos/modules/config/qt.nix index a145eaab4f1a..87d07ccfb342 100644 --- a/nixos/modules/config/qt.nix +++ b/nixos/modules/config/qt.nix @@ -30,6 +30,12 @@ let optionalAttrs (cfg.iconTheme != null) { Theme = cfg.iconTheme.name; }; + qt = + optionalAttrs (cfg.font != null) + { font = ''"${cfg.font.name}"''; } + // + { style = "GTK+"; }; + fontType = types.submodule { options = { package = mkOption { @@ -168,6 +174,14 @@ in enable = mkEnableOption "Qt theming configuration"; + qt4 = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable theming for obsolete Qt4 engine. + ''; + }; + platformTheme = mkOption { type = types.enum (attrNames platforms); example = head (attrNames platforms); @@ -227,7 +241,12 @@ in environment.variables = attrByPath [ cfg.platformTheme "environment" "variables" ] {} platforms; - environment.etc = attrByPath [ cfg.platformTheme "environment" "etc" ] {} platforms; + environment.etc = attrByPath [ cfg.platformTheme "environment" "etc" ] {} platforms // { + "xdg/Trolltech.conf".text = + toQtIni { + Qt = qt; + }; + }; environment.systemPackages = attrByPath [ cfg.platformTheme "environment" "systemPackages" ] [] platforms ++ optionalPackage cfg.font