From e5b415904c03551584be63fd8716cb0c4f70ec7a Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Tue, 6 Jan 2026 14:07:05 -0500 Subject: [PATCH] finally fix gtk3 theme and home-manager split from system --- flake.lock | 112 ++++++++++++++++-- flake.nix | 28 ++++- home/default.nix | 168 -------------------------- home/theming/default.nix | 247 +++++++++++++++++++++++++++++++++++++++ system/default.nix | 23 ---- 5 files changed, 375 insertions(+), 203 deletions(-) create mode 100644 home/theming/default.nix diff --git a/flake.lock b/flake.lock index 37501a6..3a21140 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,27 @@ "type": "github" } }, + "banner": { + "inputs": { + "nixpkgs": [ + "gtk-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1669224926, + "narHash": "sha256-UK19yx8jNqbPfBZNUeJr2Sms7BhbDAUyJBF5w2CT6Hc=", + "owner": "the-argus", + "repo": "banner.nix", + "rev": "253556f4068f5cb9728e49ac42d630cdc0ccfd58", + "type": "github" + }, + "original": { + "owner": "the-argus", + "repo": "banner.nix", + "type": "github" + } + }, "cachyos-kernel": { "flake": false, "locked": { @@ -179,6 +200,44 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gtk-nix": { + "inputs": { + "banner": "banner", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1692384535, + "narHash": "sha256-lFOEsDLV7kuEAcHS7HfyGewTcdSkzTxM+l3XwGhzLgU=", + "owner": "the-argus", + "repo": "gtk-nix", + "rev": "e77b9e68aa818b87389c682b4fd018ad451a85d3", + "type": "github" + }, + "original": { + "owner": "the-argus", + "repo": "gtk-nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -263,7 +322,7 @@ "cachyos-kernel-patches": "cachyos-kernel-patches", "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1767635460, @@ -281,18 +340,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1767593864, - "narHash": "sha256-AtzRYWSxsyvySDzfOek0lKQXoQrHtpFHbBPZ6rdQIEA=", + "lastModified": 1692264070, + "narHash": "sha256-WepAkIL2UcHOj7JJiaFS/vxrA9lklQHv8p+xGL+7oQ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1b717f421d250290b16de9a6033ea28258c46ae1", + "rev": "42c25608aa2ad4e5d3716d8d63c606063513ba33", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable-small", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" } }, "nixpkgs-lib": { @@ -327,6 +385,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1767593864, + "narHash": "sha256-AtzRYWSxsyvySDzfOek0lKQXoQrHtpFHbBPZ6rdQIEA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1b717f421d250290b16de9a6033ea28258c46ae1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1767388185, "narHash": "sha256-bmDUBlqgpIAXQ0QFn1fWpurlc+j2sI+B5941PWsic3M=", @@ -348,7 +422,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1767608728, @@ -433,10 +507,11 @@ "apple-silicon": "apple-silicon", "catppuccin": "catppuccin", "catppuccin-palette": "catppuccin-palette", + "gtk-nix": "gtk-nix", "home-manager": "home-manager", "niri": "niri", "nix-cachyos-kernel": "nix-cachyos-kernel", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixvim": "nixvim", "noctalia": "noctalia", "nur": "nur", @@ -449,7 +524,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1767502559, @@ -495,6 +570,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index ab2e555..f63a36b 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,8 @@ url = "github:abhinandh-s/catppuccin-nix"; }; + gtk-nix.url = "github:the-argus/gtk-nix"; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -63,6 +65,7 @@ nix-cachyos-kernel, catppuccin, catppuccin-palette, + gtk-nix, home-manager, plasma-manager, niri, @@ -111,6 +114,29 @@ home-manager.nixosModules.home-manager noctalia.nixosModules.default { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.sckova = { + imports = [ + ./home + ./home/games/minecraft + ./home/games/morrowind + ./home/graphical/discord + ./home/graphical/firefox + ./home/graphical/mpv + ./home/tiling/niri + ./home/tiling/wallpaper + ./home/systemd + ./home/terminal/btop + ./home/terminal/fish + ./home/terminal/kitty + ./home/terminal/nvim + ./home/kde + ./home/theming + ./home/vscode + ./home/hosts/${hostname} + ]; + }; home-manager.sharedModules = [ plasma-manager.homeModules.plasma-manager niri.homeModules.niri @@ -119,7 +145,7 @@ nixvim.homeModules.nixvim ]; home-manager.extraSpecialArgs = { - inherit spicetify-nix; + inherit gtk-nix spicetify-nix; }; } ] diff --git a/home/default.nix b/home/default.nix index 643a7cf..d63664e 100755 --- a/home/default.nix +++ b/home/default.nix @@ -205,174 +205,6 @@ pkgs.catppuccin-cursors."${config.catppuccin.flavor}${config.catppuccinUpper.accent}" ]; - home.file = { - ".icons/default/index.theme" = { - text = '' - [Icon Theme] - Name=Default - Comment=Default Cursor Theme - Inherits=${config.userOptions.cursor.name} - ''; - force = true; - }; - }; - - home.pointerCursor = { - gtk.enable = true; - name = config.userOptions.cursor.name; - package = config.userOptions.cursor.package; - size = config.userOptions.cursor.size; - }; - - home.sessionVariables = { - QT_QPA_PLATFORMTHEME = "qt6ct"; - }; - - gtk = { - enable = true; - - colorScheme = - if config.userOptions.isDark - then "dark" - else "light"; - - # theme = { - # package = pkgs.kdePackages.breeze-gtk; - # name = - # if config.userOptions.isDark - # then "Breeze-Dark" - # else "Breeze"; - # }; - - iconTheme = { - name = - if config.userOptions.isDark - then "Colloid-Dark" - else "Colloid-Light"; - package = pkgs.colloid-icon-theme; - }; - - cursorTheme = { - name = config.home.pointerCursor.name; - package = config.home.pointerCursor.package; - size = config.home.pointerCursor.size; - }; - - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = true; - }; - - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = true; - }; - }; - - qt = { - enable = true; - qt5ctSettings = { - Appearance = { - style = "Breeze"; - icon_theme = config.gtk.iconTheme.name; - color_scheme_path = "/home/${config.userOptions.username}/.config/qt5ct/qt5ct.conf"; - custom_palette = true; - standard_dialogs = "default"; - }; - Fonts = config.qt.qt6ctSettings.Fonts; - ColorScheme = config.qt.qt6ctSettings.ColorScheme; - }; - qt6ctSettings = { - Appearance = { - style = "Breeze"; - icon_theme = config.gtk.iconTheme.name; - color_scheme_path = "/home/${config.userOptions.username}/.config/qt6ct/qt6ct.conf"; - custom_palette = true; - standard_dialogs = "default"; - }; - Fonts = { - fixed = "\"${config.userOptions.fontMono.name},${toString config.userOptions.fontMono.size}\""; - general = "\"${config.userOptions.fontSans.name},${toString config.userOptions.fontSans.size}\""; - }; - ColorScheme = let - c = pkgs.catppuccin.bare.${config.catppuccin.flavor}; - accent = c.${config.catppuccin.accent}; - mkColors = roles: builtins.concatStringsSep ", " (map (r: "#ff${r}") roles); - in { - active_colors = mkColors [ - c.text - c.surface0 - c.surface1 - c.surface0 - c.base - c.mantle - c.text - c.text - c.text - c.base - c.mantle - c.crust - accent - c.base - accent - c.mauve - c.mantle - "000000" - c.base - c.text - c.overlay0 - accent - ]; - disabled_colors = mkColors [ - c.overlay0 - c.surface0 - c.surface1 - c.surface0 - c.overlay0 - c.mantle - c.overlay0 - c.text - c.overlay0 - c.surface0 - c.surface0 - c.mantle - c.overlay1 - c.text - "0000ff" - "ff00ff" - c.surface0 - "000000" - c.surface0 - c.base - "80000000" - c.overlay1 - ]; - inactive_colors = mkColors [ - c.text - c.surface0 - c.surface1 - c.surface0 - c.base - c.mantle - c.text - c.text - c.text - c.base - c.mantle - c.crust - accent - c.base - accent - c.mauve - c.mantle - "000000" - c.base - c.text - c.overlay0 - accent - ]; - }; - }; - }; - services = { spotifyd = { enable = true; diff --git a/home/theming/default.nix b/home/theming/default.nix new file mode 100644 index 0000000..a0829c3 --- /dev/null +++ b/home/theming/default.nix @@ -0,0 +1,247 @@ +{ + config, + pkgs, + gtk-nix, + ... +}: { + home.file = { + ".icons/default/index.theme" = { + text = '' + [Icon Theme] + Name=Default + Comment=Default Cursor Theme + Inherits=${config.userOptions.cursor.name} + ''; + force = true; + }; + }; + + home.pointerCursor = { + gtk.enable = true; + name = config.userOptions.cursor.name; + package = config.userOptions.cursor.package; + size = config.userOptions.cursor.size; + }; + + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = "qt6ct"; + }; + + gtk = { + enable = true; + theme.name = "GtkNix"; + + colorScheme = + if config.userOptions.isDark + then "dark" + else "light"; + + # theme = { + # package = pkgs.kdePackages.breeze-gtk; + # name = + # if config.userOptions.isDark + # then "Breeze-Dark" + # else "Breeze"; + # }; + + iconTheme = { + name = + if config.userOptions.isDark + then "Colloid-Dark" + else "Colloid-Light"; + package = pkgs.colloid-icon-theme; + }; + + cursorTheme = { + name = config.home.pointerCursor.name; + package = config.home.pointerCursor.package; + size = config.home.pointerCursor.size; + }; + + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + }; + + imports = [gtk-nix.homeManagerModule]; + + gtkNix = let + color = pkgs.catppuccin.bare.${config.catppuccin.flavor}; + in { + enable = true; + + configuration = { + spacing-small = "0.3em"; + spacing-medium = "0.6em"; + spacing-large = "0.9em"; + tint-weak = 0.3; + tint-medium = 0.6; + tint-strong = 0.9; + border-size = "0.2em"; + radius = "0.5em"; + disabled-opacity = 0.3; + }; + + defaultTransparency = 255; + + palette = rec { + base00 = color.base; + base01 = color.mantle; + base02 = color.surface0; + base03 = color.surface1; + base04 = color.surface2; + base05 = color.text; + base06 = color.rosewater; + base07 = color.lavender; + base08 = color.red; + base09 = color.peach; + base0A = color.yellow; + base0B = color.green; + base0C = color.teal; + base0D = color.blue; + base0E = color.mauve; + base0F = color.flamingo; + + highlight = color.${config.catppuccin.accent}; + hialt0 = color.${config.catppuccin.accent}; + hialt1 = base0E; + hialt2 = base0B; + urgent = base09; + warn = base0A; + confirm = base0D; + link = base0E; + + pfg-highlight = base00; + pfg-hialt0 = base00; + pfg-hialt1 = base00; + pfg-hialt2 = base05; + pfg-urgent = base00; + pfg-warn = base00; + pfg-confirm = base00; + pfg-link = base00; + + ansi00 = base03; + ansi01 = base09; + ansi02 = base0D; + ansi03 = base0A; + ansi04 = base0C; + ansi05 = base0E; + ansi06 = base0B; + ansi07 = base05; + }; + }; + + qt = { + enable = true; + + qt5ctSettings = { + Appearance = { + style = "Breeze"; + icon_theme = config.gtk.iconTheme.name; + color_scheme_path = "/home/${config.userOptions.username}/.config/qt5ct/qt5ct.conf"; + custom_palette = true; + standard_dialogs = "xdgdesktopportal"; + }; + Fonts = config.qt.qt6ctSettings.Fonts; + ColorScheme = config.qt.qt6ctSettings.ColorScheme; + }; + + qt6ctSettings = { + Appearance = { + style = "Breeze"; + icon_theme = config.gtk.iconTheme.name; + color_scheme_path = "/home/${config.userOptions.username}/.config/qt6ct/qt6ct.conf"; + custom_palette = true; + standard_dialogs = "xdgdesktopportal"; + }; + + Fonts = { + fixed = "\"${config.userOptions.fontMono.name},${toString config.userOptions.fontMono.size}\""; + general = "\"${config.userOptions.fontSans.name},${toString config.userOptions.fontSans.size}\""; + }; + + ColorScheme = let + c = pkgs.catppuccin.bare.${config.catppuccin.flavor}; + accent = c.${config.catppuccin.accent}; + mkColors = roles: builtins.concatStringsSep ", " (map (r: "#ff${r}") roles); + in { + active_colors = mkColors [ + c.text + c.surface0 + c.surface1 + c.surface0 + c.base + c.mantle + c.text + c.text + c.text + c.base + c.mantle + c.crust + accent + c.base + accent + c.mauve + c.mantle + "000000" + c.base + c.text + c.overlay0 + accent + ]; + disabled_colors = mkColors [ + c.overlay0 + c.surface0 + c.surface1 + c.surface0 + c.overlay0 + c.mantle + c.overlay0 + c.text + c.overlay0 + c.surface0 + c.surface0 + c.mantle + c.overlay1 + c.text + "0000ff" + "ff00ff" + c.surface0 + "000000" + c.surface0 + c.base + "80000000" + c.overlay1 + ]; + inactive_colors = mkColors [ + c.text + c.surface0 + c.surface1 + c.surface0 + c.base + c.mantle + c.text + c.text + c.text + c.base + c.mantle + c.crust + accent + c.base + accent + c.mauve + c.mantle + "000000" + c.base + c.text + c.overlay0 + accent + ]; + }; + }; + }; +} diff --git a/system/default.nix b/system/default.nix index a2c6374..f8be213 100755 --- a/system/default.nix +++ b/system/default.nix @@ -46,29 +46,6 @@ options = "--delete-older-than 30d"; }; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.sckova = { - imports = [ - ../home - ../home/games/minecraft - ../home/games/morrowind - ../home/graphical/discord - ../home/graphical/firefox - ../home/graphical/mpv - ../home/tiling/niri - ../home/tiling/wallpaper - ../home/systemd - ../home/terminal/btop - ../home/terminal/fish - ../home/terminal/kitty - ../home/terminal/nvim - ../home/kde - ../home/vscode - ../home/hosts/${config.networking.hostName} - ]; - }; - environment.sessionVariables = rec { NIXOS_OZONE_WL = "1"; EDITOR = "nvim";