From b8ac7247a52c30e86c210e8922408927c141df0c Mon Sep 17 00:00:00 2001 From: voidarc Date: Mon, 6 Jul 2026 20:01:01 +0100 Subject: [PATCH] fixed gtk theming to use gsettings --- modules/system/gtk/cursor.nix | 36 +++++++++++++++++ modules/system/gtk/default.nix | 73 +++------------------------------- modules/system/gtk/gtk.nix | 50 +++++++++++++++++++++++ 3 files changed, 91 insertions(+), 68 deletions(-) create mode 100644 modules/system/gtk/cursor.nix create mode 100644 modules/system/gtk/gtk.nix diff --git a/modules/system/gtk/cursor.nix b/modules/system/gtk/cursor.nix new file mode 100644 index 0000000..d453379 --- /dev/null +++ b/modules/system/gtk/cursor.nix @@ -0,0 +1,36 @@ +{ + self, + inputs, + ... +}: { + flake.nixosModules.bibataCursors = { + pkgs, + lib, + ... + }: let + in { + fonts.packages = with pkgs.nerd-fonts; [ + fira-mono + ]; + environment.systemPackages = with pkgs; [ + bibata-cursors + ]; + + environment.variables = { + XCURSOR_THEME = "Bibata-Modern-Ice"; + XCURSOR_SIZE = "20"; + }; + + programs.dconf.profiles.user.databases = [ + { + lockAll = false; + settings = { + "org/gnome/desktop/interface" = { + cursor-theme = "Bibata-Modern-Ice"; + font-name = "FiraMono Nerd Font 11"; + }; + }; + } + ]; + }; +} diff --git a/modules/system/gtk/default.nix b/modules/system/gtk/default.nix index ab2e5d1..3957fba 100644 --- a/modules/system/gtk/default.nix +++ b/modules/system/gtk/default.nix @@ -3,80 +3,17 @@ inputs, ... }: { - perSystem = { - pkgs, - system, - ... - }: { - packages.catppuccinGtkMochaMauve = pkgs.catppuccin-gtk.override { - variant = "mocha"; - accents = ["mauve"]; - size = "standard"; - tweaks = ["rimless"]; - }; - }; - - flake.nixosModules.gtkTheme = { + flake.nixosModules.systemTheme = { config, pkgs, lib, ... }: let - catppuccinGtk = pkgs.catppuccin-gtk.override { - variant = "mocha"; - accents = ["mauve"]; - size = "standard"; - tweaks = ["rimless"]; - }; - - gtkThemeName = "Catppuccin-Mocha-Standard-Mauve-Dark"; - - gtkSettingsCommon = '' - gtk-application-prefer-dark-theme = true - gtk-theme-name = ${gtkThemeName} - gtk-icon-theme-name = Catppuccin-Mocha-Mauve - gtk-font-name = FiraMono Nerd Font 11 - gtk-cursor-theme-name = Bibata-Modern-Ice - gtk-cursor-theme-size = 20 - ''; - in { - fonts.packages = [pkgs.nerd-fonts.fira-mono]; - - environment.systemPackages = with pkgs; [ + modules = with self.nixosModules; [ + bibataCursors catppuccinGtk - bibata-cursors - catppuccin-icons - ]; - - environment.etc = { - "gtk-3.0/settings.ini".source = pkgs.writeText "gtk3-settings.ini" '' - [Settings] - ${gtkSettingsCommon} - ''; - - "gtk-4.0/settings.ini".source = pkgs.writeText "gtk4-settings.ini" '' - [Settings] - ${gtkSettingsCommon} - ''; - }; - - environment.variables = { - XCURSOR_THEME = "Bibata-Modern-Ice"; - XCURSOR_SIZE = "20"; - }; - - programs.dconf.profiles.user.databases = [ - { - lockAll = false; - settings = { - "org/gnome/desktop/interface" = { - gtk-theme = gtkThemeName; - icon-theme = "Catppuccin-Mocha-Mauve"; - cursor-theme = "Bibata-Modern-Ice"; - font-name = "FiraMono Nerd Font 11"; - }; - }; - } ]; + in { + imports = modules; }; } diff --git a/modules/system/gtk/gtk.nix b/modules/system/gtk/gtk.nix new file mode 100644 index 0000000..e6f49ad --- /dev/null +++ b/modules/system/gtk/gtk.nix @@ -0,0 +1,50 @@ +{ + self, + inputs, + ... +}: { + flake.nixosModules.catppuccinGtk = { + pkgs, + lib, + ... + }: let + modules = [ + inputs.catppuccin.nixosModules.catppuccin + ]; + in { + environment.systemPackages = with pkgs; [ + (catppuccin-gtk.override { + variant = "mocha"; + accents = ["mauve"]; + tweaks = ["rimless"]; + size = "compact"; + }) + (catppuccin-papirus-folders.override { + flavor = "mocha"; + accent = "mauve"; + }) + ]; + imports = modules; + catppuccin = { + enable = true; + autoEnable = false; + accent = "mauve"; + flavor = "mocha"; + gtk = { + icon.enable = true; + }; + }; + programs.dconf.profiles.user.databases = [ + { + lockAll = false; + settings = { + "org/gnome/desktop/interface" = { + gtk-theme = "catppuccin-mocha-mauve-compact+rimless"; + icon-theme = "Papirus"; + color-scheme = "prefer-dark"; + }; + }; + } + ]; + }; +}