diff options
author | Robert Helgesson <robert@rycee.net> | 2018-05-17 19:39:26 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2018-05-18 20:57:36 +0200 |
commit | b6da6569c4ff53cf0cabd5371b501069810febf3 (patch) | |
tree | a43128f53be3adef6b94387f27fb3634079af019 /modules/misc/qt.nix | |
parent | bbcef2fd33165c987ec0b746211782aca7815ac6 (diff) |
qt: add module
Diffstat (limited to 'modules/misc/qt.nix')
-rw-r--r-- | modules/misc/qt.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix new file mode 100644 index 00000000000..ae697b25ec2 --- /dev/null +++ b/modules/misc/qt.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.qt; + dag = config.lib.dag; + +in + +{ + meta.maintainers = [ maintainers.rycee ]; + + options = { + qt = { + enable = mkEnableOption "Qt 4 and 5 configuration"; + + useGtkTheme = mkOption { + type = types.bool; + default = false; + description = '' + Whether Qt 4 and 5 should be set up to use the GTK theme + settings. + ''; + }; + }; + }; + + config = mkIf (cfg.enable && cfg.useGtkTheme) { + home.sessionVariables.QT_QPA_PLATFORMTHEME = "gtk2"; + home.packages = [ pkgs.libsForQt5.qtstyleplugins ]; + + home.activation.useGtkThemeInQt4 = dag.entryAfter ["writeBoundary"] '' + $DRY_RUN_CMD ${pkgs.crudini}/bin/crudini $VERBOSE_ARG \ + --set $HOME/.config/Trolltech.conf Qt style GTK+ + ''; + }; +} |