From 1bd7ea84ad7e2bb4643ecf0f62e376aeb05ad7be Mon Sep 17 00:00:00 2001 From: gnidorah Date: Sun, 13 Oct 2019 08:55:36 +0300 Subject: [PATCH] nixos/qt5: rename to qt --- nixos/modules/config/{qt5.nix => qt.nix} | 24 ++++++++++++------- nixos/modules/module-list.nix | 2 +- .../x11/desktop-managers/pantheon.nix | 6 ++--- 3 files changed, 20 insertions(+), 12 deletions(-) rename nixos/modules/config/{qt5.nix => qt.nix} (88%) diff --git a/nixos/modules/config/qt5.nix b/nixos/modules/config/qt.nix similarity index 88% rename from nixos/modules/config/qt5.nix rename to nixos/modules/config/qt.nix index fb3e03c4b3fe..a145eaab4f1a 100644 --- a/nixos/modules/config/qt5.nix +++ b/nixos/modules/config/qt.nix @@ -4,7 +4,7 @@ with lib; let - cfg = config.qt5; + cfg = config.qt; toQtIni = generators.toINI { mkKeyValue = key: value: @@ -79,7 +79,7 @@ let } { assertion = cfg.font == null && cfg.iconTheme == null; - message = "`qt5.font` and `qt5.iconTheme` are only supported by kde platform."; + message = "`qt.font` and `qt.iconTheme` are only supported by kde platform."; } ]; environment.variables.QT_QPA_PLATFORMTHEME = "gtk2"; @@ -99,7 +99,7 @@ let assertions = [ { assertion = cfg.font == null && cfg.iconTheme == null; - message = "`qt5.font` and `qt5.iconTheme` are only supported by kde platform."; + message = "`qt.font` and `qt.iconTheme` are only supported by kde platform."; } ]; environment.variables.QT_QPA_PLATFORMTHEME = "qgnomeplatform"; @@ -126,7 +126,7 @@ let } { assertion = cfg.font == null && cfg.iconTheme == null; - message = "`qt5.font` and `qt5.iconTheme` are only supported by kde platform."; + message = "`qt.font` and `qt.iconTheme` are only supported by kde platform."; } ]; environment.variables.QT_QPA_PLATFORMTHEME = "gtk3"; @@ -155,16 +155,24 @@ in { - options = { - qt5 = { + imports = [ + (mkRenamedOptionModule [ "qt5" "style" ] [ "qt" "style" ]) + (mkRenamedOptionModule [ "qt5" "enable" ] [ "qt" "enable" ]) + (mkRenamedOptionModule [ "qt5" "platformTheme" ] [ "qt" "platformTheme" ]) + (mkRenamedOptionModule [ "qt5" "font" ] [ "qt" "font" ]) + (mkRenamedOptionModule [ "qt5" "iconTheme" ] [ "qt" "iconTheme" ]) + ]; - enable = mkEnableOption "Qt5 theming configuration"; + options = { + qt = { + + enable = mkEnableOption "Qt theming configuration"; platformTheme = mkOption { type = types.enum (attrNames platforms); example = head (attrNames platforms); description = '' - Selects the platform theme to use for Qt5 applications. + Selects the platform theme to use for Qt applications. The options are ${concatStrings (mapAttrsToList (name: value: value.description) platforms)} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 101c235e63f4..089737fcf0ae 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -27,7 +27,7 @@ ./config/nsswitch.nix ./config/power-management.nix ./config/pulseaudio.nix - ./config/qt5.nix + ./config/qt.nix ./config/resolvconf.nix ./config/shells-environment.nix ./config/swap.nix diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index b46a2d189ef9..5b3fea845964 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -242,9 +242,9 @@ in programs.zsh.vteIntegration = mkDefault true; # Harmonize Qt5 applications under Pantheon - qt5.enable = true; - qt5.platformTheme = "gnome"; - qt5.style = "adwaita"; + qt.enable = true; + qt.platformTheme = "qgnomeplatform"; + qt.style.name = "adwaita"; # Default Fonts fonts.fonts = with pkgs; [