From 954f29fbcba887d5f1665fe567268e14fd8b15ca Mon Sep 17 00:00:00 2001 From: EnzioKam Date: Wed, 17 Apr 2024 11:44:19 +0800 Subject: [PATCH] fix(home-manager): fix formatting for gtk.nix --- modules/home-manager/gtk.nix | 62 +++++++++++++++--------------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/modules/home-manager/gtk.nix b/modules/home-manager/gtk.nix index 16ef9f58..905cb9c7 100644 --- a/modules/home-manager/gtk.nix +++ b/modules/home-manager/gtk.nix @@ -1,39 +1,30 @@ -{ config -, pkgs -, lib -, ... -}: +{ config, pkgs, lib, ... }: let inherit (lib) ctp mkOption types; cfg = config.gtk.catppuccin; enable = cfg.enable && config.gtk.enable; in { - options.gtk.catppuccin = - ctp.mkCatppuccinOpt "gtk" - // { - accent = ctp.mkAccentOpt "gtk"; - size = mkOption { - type = types.enum [ "standard" "compact" ]; - default = "standard"; - description = "Catppuccin size variant for gtk"; - }; - tweaks = mkOption { - type = types.listOf (types.enum [ "black" "rimless" "normal" ]); - default = [ "normal" ]; - description = "Catppuccin tweaks for gtk"; - }; + options.gtk.catppuccin = ctp.mkCatppuccinOpt "gtk" // { + accent = ctp.mkAccentOpt "gtk"; + size = mkOption { + type = types.enum [ "standard" "compact" ]; + default = "standard"; + description = "Catppuccin size variant for gtk"; + }; + tweaks = mkOption { + type = types.listOf (types.enum [ "black" "rimless" "normal" ]); + default = [ "normal" ]; + description = "Catppuccin tweaks for gtk"; + }; - cursor = ctp.mkCatppuccinOpt "gtk cursors" - // { - accent = ctp.mkAccentOpt "gtk cursors"; - }; + cursor = ctp.mkCatppuccinOpt "gtk cursors" // { + accent = ctp.mkAccentOpt "gtk cursors"; }; + }; config = lib.mkIf enable { - assertions = [ - (lib.ctp.assertXdgEnabled "gtk") - ]; + assertions = [ (lib.ctp.assertXdgEnabled "gtk") ]; gtk = { theme = @@ -43,13 +34,11 @@ in sizeUpper = ctp.mkUpper cfg.size; # use the light gtk theme for latte - gtkTheme = - if cfg.flavour == "latte" - then "Light" - else "Dark"; + gtkTheme = if cfg.flavour == "latte" then "Light" else "Dark"; in { - name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}"; + name = + "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}"; package = pkgs.catppuccin-gtk.override { inherit (cfg) size tweaks; accents = [ cfg.accent ]; @@ -70,12 +59,13 @@ in xdg.configFile = let - gtk4Dir = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0"; + gtk4Dir = + "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0"; in { - "gtk-4.0/assets".source = "${gtk4Dir}/assets"; - "gtk-4.0/gtk.css".source = "${gtk4Dir}/gtk.css"; - "gtk-4.0/gtk-dark.css".source = "${gtk4Dir}/gtk-dark.css"; - }; + "gtk-4.0/assets".source = "${gtk4Dir}/assets"; + "gtk-4.0/gtk.css".source = "${gtk4Dir}/gtk.css"; + "gtk-4.0/gtk-dark.css".source = "${gtk4Dir}/gtk-dark.css"; + }; }; }