home-manager/tests/modules/misc/qt/qt-platform-theme-gnome.nix
Thiago Kenji Okada 0e2dc4be30
qt: add qt.style option (#1839)
This allows you to set a theme for Qt applications. For example, if you
want to use `adwaita-qt` theme to have uniform look between Gtk and Qt
applications, you can use it like this:

```nix
{
  qt = {
    enable = true;
    platformTheme = "gnome";
    style = {
      name = "adwaita";
      package = pkgs.adwaita-qt;
    };
  };
}
```
2021-03-03 22:20:17 -05:00

28 lines
579 B
Nix

{ config, lib, pkgs, ... }:
{
config = {
qt = {
enable = true;
platformTheme = "gnome";
style = {
name = "adwaita";
package = pkgs.dummyTheme;
};
};
nixpkgs.overlays = [
(self: super: {
dummyTheme = pkgs.runCommandLocal "theme" { } "mkdir $out";
})
];
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gnome"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_STYLE_OVERRIDE="adwaita"'
'';
};
}