From 82b9cfae5e2da156627265c29ca8d92aafea0479 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Fri, 14 Jul 2023 21:18:49 -0500 Subject: [PATCH] feat: gtk Signed-off-by: jolheiser --- apps/default.nix | 1 + apps/gtk.nix | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 apps/gtk.nix diff --git a/apps/default.nix b/apps/default.nix index c18e505..c44d2a0 100644 --- a/apps/default.nix +++ b/apps/default.nix @@ -12,6 +12,7 @@ ./gpg.nix ./git.nix ./go.nix + ./gtk.nix ./helix.nix ./jq.nix ./nushell.nix diff --git a/apps/gtk.nix b/apps/gtk.nix new file mode 100644 index 0000000..62c0d1a --- /dev/null +++ b/apps/gtk.nix @@ -0,0 +1,55 @@ +{ + config, + lib, + pkgs, + ... +}: { + home.pointerCursor = { + name = "catppuccin-cursors"; + package = pkgs.catppuccin-cursors.mochaLavender; + size = 24; + }; + gtk = { + enable = true; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.catppuccin-papirus-folders.override { + flavor = "mocha"; + accent = "lavender"; + }; + }; + theme = { + name = "Catppuccin-Mocha-Compact-Lavender-Dark"; + package = pkgs.catppuccin-gtk.override { + accents = ["lavender"]; + variant = "mocha"; + size = "compact"; + }; + }; + gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + gtk2.extraConfig = '' + gtk-xft-antialias=1 + gtk-xft-hinting=1 + gtk-xft-hintstyle="hintslight" + gtk-xft-rgba="rgb" + ''; + gtk3.extraConfig = { + gtk-xft-antialias = 1; + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintslight"; + gtk-xft-rgba = "rgb"; + }; + }; + + xdg = let + themeDir = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}"; + in + lib.mkIf config.gtk.enable { + configFile."gtk-4.0/assets" = { + source = "${themeDir}/gtk-4.0/assets"; + recursive = true; + }; + configFile."gtk-4.0/gtk.css".source = "${themeDir}/gtk-4.0/gtk.css"; + configFile."gtk-4.0/gtk-dark.css".source = "${themeDir}/gtk-4.0/gtk-dark.css"; + }; +}