nixcfg/homeManagerModules/theme.nix

153 lines
3.7 KiB
Nix
Raw Normal View History

{
pkgs,
lib,
config,
...
2024-07-09 23:41:52 -04:00
}: let
cfg = config.ar.home.theme;
in {
config = lib.mkIf cfg.enable {
home = {
2024-07-14 15:45:23 -04:00
packages = with pkgs; [
2024-08-04 15:53:29 -04:00
(nerdfonts.override {fonts = ["UbuntuSans"];})
2024-07-14 15:45:23 -04:00
adwaita-qt
gnome.adwaita-icon-theme
liberation_ttf
vegur
2024-07-14 15:45:23 -04:00
];
2024-07-09 23:41:52 -04:00
pointerCursor = {
gtk.enable = true;
name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors;
size = lib.mkDefault 24;
2024-07-09 23:41:52 -04:00
x11 = {
enable = true;
defaultCursor = config.home.pointerCursor.name;
};
};
2024-07-09 23:41:52 -04:00
};
2024-07-09 23:41:52 -04:00
fonts.fontconfig = {
enable = true;
2024-07-09 23:41:52 -04:00
defaultFonts = {
2024-08-04 15:53:29 -04:00
monospace = ["UbuntuSansMono Nerd Font" "Liberation Mono"];
serif = ["Vegur" "Liberation Serif"];
sansSerif = [config.gtk.font.name "LIberation Sans"];
};
2024-07-09 23:41:52 -04:00
};
2024-07-09 23:41:52 -04:00
gtk = {
enable = true;
2024-07-09 23:41:52 -04:00
theme = {
package = pkgs.adw-gtk3;
name =
if cfg.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
};
2024-07-07 01:51:26 -04:00
2024-07-09 23:41:52 -04:00
iconTheme = {
package = pkgs.papirus-icon-theme;
name =
if cfg.darkMode
then "Papirus-Dark"
else "Papirus";
};
2024-07-09 23:41:52 -04:00
font = {
name = "UbuntuSans Nerd Font";
package = pkgs.nerdfonts.override {fonts = ["UbuntuSans"];};
2024-07-09 23:41:52 -04:00
size = lib.mkDefault 11;
};
2024-07-10 23:43:51 -04:00
gtk3 = {
extraConfig = lib.attrsets.optionalAttrs (cfg.darkMode) {gtk-application-prefer-dark-theme = 1;};
extraCss = ''
@define-color accent_bg_color ${cfg.colors.primary};
@define-color accent_color @accent_bg_color;
${
lib.strings.optionalString
cfg.gtk.hideTitleBar
''
/* No (default) title bar on wayland */
headerbar.default-decoration {
/* You may need to tweak these values depending on your GTK theme */
margin-bottom: 50px;
margin-top: -100px;
background: transparent;
padding: 0;
border: 0;
min-height: 0;
font-size: 0;
box-shadow: none;
}
/* rm -rf window shadows */
window.csd, /* gtk4? */
window.csd decoration { /* gtk3 */
box-shadow: none;
}
''
}
'';
};
gtk4 = {
extraConfig = lib.attrsets.optionalAttrs (cfg.darkMode) {gtk-application-prefer-dark-theme = 1;};
extraCss = config.gtk.gtk3.extraCss;
};
2024-07-09 23:41:52 -04:00
};
2024-07-09 23:41:52 -04:00
qt = {
enable = true;
platformTheme.name = "qtct";
style = {
2024-07-14 15:45:23 -04:00
package = pkgs.adwaita-qt6;
2024-07-09 23:41:52 -04:00
name =
if cfg.darkMode
then "Adwaita-Dark"
else "Adwaita";
};
};
2024-07-09 23:41:52 -04:00
dconf.settings = {
"org/gnome/desktop/background" = {
picture-uri = "file://${cfg.wallpaper}";
picture-uri-dark = "file://${cfg.wallpaper}";
};
2024-07-09 23:41:52 -04:00
"org/gnome/desktop/interface" = {
color-scheme =
if cfg.darkMode
then "prefer-dark"
else "prefer-light";
2024-07-09 23:41:52 -04:00
cursor-theme = config.home.pointerCursor.name;
cursor-size = config.home.pointerCursor.size;
document-font-name = "Vegur ${toString config.gtk.font.size}";
2024-07-09 23:41:52 -04:00
gtk-theme =
if cfg.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
2024-07-09 23:41:52 -04:00
icon-theme =
if cfg.darkMode
then "Papirus-Dark"
else "Papirus";
monospace-font-name = "UbuntuSansMono Nerd Font ${toString config.gtk.font.size}";
};
2024-07-09 23:41:52 -04:00
"org/gnome/desktop/wm/preferences".titlebar-font = "${config.gtk.font.name} ${toString config.gtk.font.size}";
};
2024-07-09 23:41:52 -04:00
};
}