diff --git a/modules/system/gtk/default.nix b/modules/system/gtk/default.nix new file mode 100644 index 0000000..ab2e5d1 --- /dev/null +++ b/modules/system/gtk/default.nix @@ -0,0 +1,82 @@ +{ + self, + inputs, + ... +}: { + perSystem = { + pkgs, + system, + ... + }: { + packages.catppuccinGtkMochaMauve = pkgs.catppuccin-gtk.override { + variant = "mocha"; + accents = ["mauve"]; + size = "standard"; + tweaks = ["rimless"]; + }; + }; + + flake.nixosModules.gtkTheme = { + 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; [ + 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"; + }; + }; + } + ]; + }; +}