qt: use qt.qt{5,6}ctSettings options (#2075)
Link: https://github.com/nix-community/stylix/pull/2075 Co-authored-by: NAHO <trueNAHO@users.noreply.github.com> Reviewed-by: NAHO <trueNAHO@users.noreply.github.com>
This commit is contained in:
parent
f6e9fbaeb3
commit
e5801bdc21
2 changed files with 29 additions and 38 deletions
6
flake/dev/flake.lock
generated
6
flake/dev/flake.lock
generated
|
|
@ -97,11 +97,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1764765981,
|
||||
"narHash": "sha256-QbjsTmAsxSVPw/w3pN1ftlOYHpOZZkXVSgoWnj43j0A=",
|
||||
"lastModified": 1765172714,
|
||||
"narHash": "sha256-/cjofqGxSWpRj2XJM+Bd5VUgWDkBWSxxO//HE+zOHMY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "43173abcb4a48adb1d56be30ed17d9afaf4310ae",
|
||||
"rev": "a7887340779d5e70ef68012f3823568ee59eaa30",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -75,46 +75,37 @@
|
|||
|
||||
home.packages = lib.optional (config.qt.style.name == "kvantum") kvantumPackage;
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
style.name = recommendedStyle;
|
||||
platformTheme.name = config.stylix.targets.qt.platform;
|
||||
};
|
||||
|
||||
xdg.configFile =
|
||||
qt =
|
||||
let
|
||||
qtctConf = ''
|
||||
[Appearance]
|
||||
custom_palette=true
|
||||
''
|
||||
+ lib.optionalString (config.qt.style ? name) ''
|
||||
style=${config.qt.style.name}
|
||||
''
|
||||
+ lib.optionalString (icons != null) ''
|
||||
icon_theme=${icons}
|
||||
''
|
||||
+ ''
|
||||
[Fonts]
|
||||
fixed="${config.stylix.fonts.monospace.name},${toString config.stylix.fonts.sizes.applications}"
|
||||
general="${config.stylix.fonts.sansSerif.name},${toString config.stylix.fonts.sizes.applications}"
|
||||
'';
|
||||
qtctSettings = {
|
||||
Appearance = {
|
||||
custom_palette = true;
|
||||
style = lib.mkIf (config.qt.style ? name) config.qt.style.name;
|
||||
icon_theme = lib.mkIf (icons != null) icons;
|
||||
};
|
||||
|
||||
Fonts = {
|
||||
fixed = ''"${config.stylix.fonts.monospace.name},${toString config.stylix.fonts.sizes.applications}"'';
|
||||
general = ''"${config.stylix.fonts.sansSerif.name},${toString config.stylix.fonts.sizes.applications}"'';
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mkMerge [
|
||||
(lib.mkIf (config.qt.style.name == "kvantum") {
|
||||
"Kvantum/kvantum.kvconfig".source =
|
||||
(pkgs.formats.ini { }).generate "kvantum.kvconfig"
|
||||
{ General.theme = "Base16Kvantum"; };
|
||||
{
|
||||
enable = true;
|
||||
style.name = recommendedStyle;
|
||||
platformTheme.name = config.stylix.targets.qt.platform;
|
||||
|
||||
"Kvantum/Base16Kvantum".source =
|
||||
"${kvantumPackage}/share/Kvantum/Base16Kvantum";
|
||||
})
|
||||
qt5ctSettings = lib.mkIf (config.qt.platformTheme.name == "qtct") qtctSettings;
|
||||
qt6ctSettings = lib.mkIf (config.qt.platformTheme.name == "qtct") qtctSettings;
|
||||
};
|
||||
|
||||
(lib.mkIf (config.qt.platformTheme.name == "qtct") {
|
||||
"qt5ct/qt5ct.conf".text = qtctConf;
|
||||
"qt6ct/qt6ct.conf".text = qtctConf;
|
||||
})
|
||||
];
|
||||
xdg.configFile = lib.mkIf (config.qt.style.name == "kvantum") {
|
||||
"Kvantum/kvantum.kvconfig".source =
|
||||
(pkgs.formats.ini { }).generate "kvantum.kvconfig"
|
||||
{ General.theme = "Base16Kvantum"; };
|
||||
"Kvantum/Base16Kvantum".source =
|
||||
"${kvantumPackage}/share/Kvantum/Base16Kvantum";
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue