theme: simplify
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-07 00:00:27 -04:00
parent 2cea9d2da2
commit 1f9cf3a012

View file

@ -5,67 +5,10 @@
... ...
}: let }: let
cfg = config.ar.home.theme; cfg = config.ar.home.theme;
in {
config = lib.mkIf cfg.enable {
home = {
packages = with pkgs; [
(nerdfonts.override {fonts = ["UbuntuSans"];})
adwaita-qt
gnome.adwaita-icon-theme
liberation_ttf
vegur
];
pointerCursor = {
gtk.enable = true;
name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors;
size = lib.mkDefault 24;
x11 = {
enable = true;
defaultCursor = config.home.pointerCursor.name;
};
};
};
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = ["UbuntuSansMono Nerd Font" "Liberation Mono"];
serif = ["Vegur" "Liberation Serif"];
sansSerif = [config.gtk.font.name "LIberation Sans"];
};
};
gtk = { gtk = {
enable = true;
theme = {
package = pkgs.adw-gtk3;
name =
if cfg.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
};
iconTheme = {
package = pkgs.papirus-icon-theme.override {color = "adwaita";};
name =
if cfg.darkMode
then "Papirus-Dark"
else "Papirus";
};
font = {
name = "UbuntuSans Nerd Font";
package = pkgs.nerdfonts.override {fonts = ["UbuntuSans"];};
size = lib.mkDefault 11;
};
gtk3 = {
extraConfig = lib.attrsets.optionalAttrs (cfg.darkMode) {gtk-application-prefer-dark-theme = 1;}; extraConfig = lib.attrsets.optionalAttrs (cfg.darkMode) {gtk-application-prefer-dark-theme = 1;};
extraCss = '' extraCss = ''
@define-color accent_bg_color ${cfg.colors.primary}; @define-color accent_bg_color ${cfg.colors.primary};
@define-color accent_color @accent_bg_color; @define-color accent_color @accent_bg_color;
@ -98,21 +41,95 @@ in {
''; '';
}; };
gtk4 = { font = {
extraConfig = lib.attrsets.optionalAttrs (cfg.darkMode) {gtk-application-prefer-dark-theme = 1;}; name = "UbuntuSans Nerd Font";
extraCss = config.gtk.gtk3.extraCss; package = pkgs.nerdfonts.override {fonts = ["UbuntuSans"];};
size = 11;
}; };
monospaceFont = {
inherit (font) package size;
name = "UbuntuSansMono Nerd Font";
};
serifFont = {
inherit (font) size;
name = "Vegur";
package = pkgs.vegur;
};
in {
config = lib.mkIf cfg.enable {
home = {
packages = [
font.package
monospaceFont.package
pkgs.adwaita-qt
pkgs.gnome.adwaita-icon-theme
pkgs.liberation_ttf
serifFont.package
];
pointerCursor = {
gtk.enable = true;
name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors;
size = lib.mkDefault 24;
x11 = {
enable = true;
defaultCursor = config.home.pointerCursor.name;
};
};
};
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = [monospaceFont.name];
sansSerif = [font.name];
serif = [serifFont.name];
};
};
gtk = {
enable = true;
theme = {
name =
if cfg.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
package = pkgs.adw-gtk3;
};
font = {inherit (font) name package size;};
iconTheme = {
name =
if cfg.darkMode
then "Papirus-Dark"
else "Papirus";
package = pkgs.papirus-icon-theme.override {color = "adwaita";};
};
gtk3 = {inherit (gtk) extraConfig extraCss;};
gtk4 = {inherit (gtk) extraConfig extraCss;};
}; };
qt = { qt = {
enable = true; enable = true;
platformTheme.name = "qtct"; platformTheme.name = "qtct";
style = { style = {
package = pkgs.adwaita-qt6;
name = name =
if cfg.darkMode if cfg.darkMode
then "Adwaita-Dark" then "Adwaita-Dark"
else "Adwaita"; else "Adwaita";
package = pkgs.adwaita-qt6;
}; };
}; };
@ -128,25 +145,11 @@ in {
then "prefer-dark" then "prefer-dark"
else "prefer-light"; else "prefer-light";
cursor-theme = config.home.pointerCursor.name; document-font-name = "${serifFont.name} ${toString serifFont.size}";
cursor-size = config.home.pointerCursor.size; monospace-font-name = "${monospaceFont.name} ${toString monospaceFont.size}";
document-font-name = "Vegur ${toString config.gtk.font.size}";
gtk-theme =
if cfg.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
icon-theme =
if cfg.darkMode
then "Papirus-Dark"
else "Papirus";
monospace-font-name = "UbuntuSansMono Nerd Font ${toString config.gtk.font.size}";
}; };
"org/gnome/desktop/wm/preferences".titlebar-font = "${config.gtk.font.name} ${toString config.gtk.font.size}"; "org/gnome/desktop/wm/preferences".titlebar-font = "${font.name} ${toString font.size}";
}; };
}; };
} }