1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-14 07:09:45 +01:00
home-manager/modules/misc/qt.nix

42 lines
933 B
Nix
Raw Normal View History

2018-05-17 19:39:26 +02:00
{ 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 ];
xsession.profileExtra =
"systemctl --user import-environment QT_QPA_PLATFORMTHEME";
2018-05-17 19:39:26 +02:00
home.activation.useGtkThemeInQt4 = dag.entryAfter ["writeBoundary"] ''
$DRY_RUN_CMD ${pkgs.crudini}/bin/crudini $VERBOSE_ARG \
--set "${config.xdg.configHome}/Trolltech.conf" Qt style GTK+
2018-05-17 19:39:26 +02:00
'';
};
}