From bd4746ff149f7e8702714c7ce4a34563eb3ab940 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 7 Sep 2023 09:36:42 +0100 Subject: [PATCH] Move configure-gtk script setting to gtk expression --- home/hyprland/default.nix | 24 +++--------------------- home/hyprland/gtk.nix | 31 +++++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 2e8db1ee..011053af 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -1,24 +1,6 @@ { config, lib, pkgs, hyprland, anyrun, wallpapers, catppuccin-themes, ... }: -let - configure-gtk = pkgs.writeTextFile { - name = "configure-gtk"; - destination = "/bin/configure-gtk"; - executable = true; - text = let - schema = pkgs.gsettings-desktop-schemas; - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; - gtk-theme = config.gtk.theme.name; - icon-theme = config.gtk.iconTheme.name; - cursor-theme = config.gtk.cursorTheme.name; - in '' - export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS - gnome_schema=org.gnome.desktop.interface - gsettings set $gnome_schema gtk-theme '${gtk-theme}' - gsettings set $gnome_schema icon-theme '${icon-theme}' - gsettings set $gnome_schema cursor-theme '${cursor-theme}' - ''; - }; -in { + +{ imports = [ hyprland.homeManagerModules.default ../alacritty/tiling.nix @@ -29,7 +11,7 @@ in { ./swaylock.nix ./gtk.nix ]; - home.packages = with pkgs; [ libsForQt5.polkit-kde-agent configure-gtk ]; + home.packages = [ pkgs.libsForQt5.polkit-kde-agent ]; programs = { emacs.package = pkgs.emacs29-pgtk; firefox.package = pkgs.firefox-wayland; diff --git a/home/hyprland/gtk.nix b/home/hyprland/gtk.nix index 5f40218c..02188336 100644 --- a/home/hyprland/gtk.nix +++ b/home/hyprland/gtk.nix @@ -1,7 +1,30 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ glib gnome.adwaita-icon-theme papirus-folders ]; +{ config, pkgs, ... }: +let + configure-gtk = pkgs.writeTextFile { + name = "configure-gtk"; + destination = "/bin/configure-gtk"; + executable = true; + text = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + gtk-theme = config.gtk.theme.name; + icon-theme = config.gtk.iconTheme.name; + cursor-theme = config.gtk.cursorTheme.name; + in '' + export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS + gnome_schema=org.gnome.desktop.interface + gsettings set $gnome_schema gtk-theme '${gtk-theme}' + gsettings set $gnome_schema icon-theme '${icon-theme}' + gsettings set $gnome_schema cursor-theme '${cursor-theme}' + ''; + }; +in { + home.packages = with pkgs; [ + glib + configure-gtk + gnome.adwaita-icon-theme + papirus-folders + ]; gtk = { enable = true; cursorTheme = {