nixos/qt5: rename to qt

This commit is contained in:
gnidorah 2019-10-13 08:55:36 +03:00
parent 379c3f685c
commit 1bd7ea84ad
3 changed files with 20 additions and 12 deletions

View File

@ -4,7 +4,7 @@ with lib;
let let
cfg = config.qt5; cfg = config.qt;
toQtIni = generators.toINI { toQtIni = generators.toINI {
mkKeyValue = key: value: mkKeyValue = key: value:
@ -79,7 +79,7 @@ let
} }
{ {
assertion = cfg.font == null && cfg.iconTheme == null; 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"; environment.variables.QT_QPA_PLATFORMTHEME = "gtk2";
@ -99,7 +99,7 @@ let
assertions = [ assertions = [
{ {
assertion = cfg.font == null && cfg.iconTheme == null; 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"; environment.variables.QT_QPA_PLATFORMTHEME = "qgnomeplatform";
@ -126,7 +126,7 @@ let
} }
{ {
assertion = cfg.font == null && cfg.iconTheme == null; 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"; environment.variables.QT_QPA_PLATFORMTHEME = "gtk3";
@ -155,16 +155,24 @@ in
{ {
options = { imports = [
qt5 = { (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 { platformTheme = mkOption {
type = types.enum (attrNames platforms); type = types.enum (attrNames platforms);
example = head (attrNames platforms); example = head (attrNames platforms);
description = '' description = ''
Selects the platform theme to use for Qt5 applications.</para> Selects the platform theme to use for Qt applications.</para>
<para>The options are <para>The options are
<variablelist> <variablelist>
${concatStrings (mapAttrsToList (name: value: value.description) platforms)} ${concatStrings (mapAttrsToList (name: value: value.description) platforms)}

View File

@ -27,7 +27,7 @@
./config/nsswitch.nix ./config/nsswitch.nix
./config/power-management.nix ./config/power-management.nix
./config/pulseaudio.nix ./config/pulseaudio.nix
./config/qt5.nix ./config/qt.nix
./config/resolvconf.nix ./config/resolvconf.nix
./config/shells-environment.nix ./config/shells-environment.nix
./config/swap.nix ./config/swap.nix

View File

@ -242,9 +242,9 @@ in
programs.zsh.vteIntegration = mkDefault true; programs.zsh.vteIntegration = mkDefault true;
# Harmonize Qt5 applications under Pantheon # Harmonize Qt5 applications under Pantheon
qt5.enable = true; qt.enable = true;
qt5.platformTheme = "gnome"; qt.platformTheme = "qgnomeplatform";
qt5.style = "adwaita"; qt.style.name = "adwaita";
# Default Fonts # Default Fonts
fonts.fonts = with pkgs; [ fonts.fonts = with pkgs; [