theme: simplify css with stylix
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run

This commit is contained in:
Aly Raffauf 2024-08-15 18:06:42 -04:00
parent 006aca4ef2
commit 659d26148a

View file

@ -5,9 +5,41 @@
... ...
}: let }: let
cfg = config.ar.home.theme; cfg = config.ar.home.theme;
in {
config = lib.mkIf cfg.enable {
home.packages = [
pkgs.gnome.adwaita-icon-theme
pkgs.liberation_ttf
];
gtk = { gtk.iconTheme = {
extraCss = name =
if config.stylix.polarity == "dark"
then "Papirus-Dark"
else "Papirus";
package = pkgs.papirus-icon-theme.override {color = "adwaita";};
};
qt = {
enable = true;
platformTheme.name = "qtct";
style = {
name =
if config.stylix.polarity == "dark"
then "Adwaita-Dark"
else "Adwaita";
package = pkgs.adwaita-qt6;
};
};
stylix.targets.gtk.extraCss = ''
// Control rounded corners
window.background { border-radius: ${toString cfg.borderRadius}; }
${
lib.strings.optionalString lib.strings.optionalString
cfg.gtk.hideTitleBar cfg.gtk.hideTitleBar
'' ''
@ -30,44 +62,8 @@
window.csd decoration { /* gtk3 */ window.csd decoration { /* gtk3 */
box-shadow: none; box-shadow: none;
} }
''
}
''; '';
}; };
in {
config = lib.mkIf cfg.enable {
home = {
packages = [
pkgs.adwaita-qt
pkgs.gnome.adwaita-icon-theme
pkgs.liberation_ttf
];
};
gtk = {
iconTheme = {
name =
if config.stylix.polarity == "dark"
then "Papirus-Dark"
else "Papirus";
package = pkgs.papirus-icon-theme.override {color = "adwaita";};
};
gtk3 = {inherit (gtk) extraCss;};
gtk4 = {inherit (gtk) extraCss;};
};
qt = {
enable = true;
platformTheme.name = "qtct";
style = {
name =
if config.stylix.polarity == "dark"
then "Adwaita-Dark"
else "Adwaita";
package = pkgs.adwaita-qt6;
};
};
};
} }