From c64d15bf2a183d063d9d0db80da5af4f2996a6f9 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Thu, 19 Mar 2026 15:38:02 -0300 Subject: [PATCH] refactor(devkit): remove duplication of code --- packages/devkit/ghostty.nix | 47 +++++++++++++++++++------------------ packages/devkit/lazygit.nix | 23 +++++++++--------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/packages/devkit/ghostty.nix b/packages/devkit/ghostty.nix index eb07638..8cdea6c 100644 --- a/packages/devkit/ghostty.nix +++ b/packages/devkit/ghostty.nix @@ -7,30 +7,31 @@ command ? null, }: let colors = import ./colors.nix; - theme = pkgs.writeText "theme" '' - palette = 0=${colors.base00} - palette = 1=${colors.base08} - palette = 2=${colors.base0B} - palette = 3=${colors.base0A} - palette = 4=${colors.base0D} - palette = 5=${colors.base0E} - palette = 6=${colors.base0C} - palette = 7=${colors.base05} - palette = 8=${colors.base03} - palette = 9=${colors.base08} - palette = 10=${colors.base0B} - palette = 11=${colors.base0A} - palette = 12=${colors.base0D} - palette = 13=${colors.base0E} - palette = 14=${colors.base0C} - palette = 15=${colors.base07} + theme = with colors; + pkgs.writeText "theme" '' + palette = 0=${base00} + palette = 1=${base08} + palette = 2=${base0B} + palette = 3=${base0A} + palette = 4=${base0D} + palette = 5=${base0E} + palette = 6=${base0C} + palette = 7=${base05} + palette = 8=${base03} + palette = 9=${base08} + palette = 10=${base0B} + palette = 11=${base0A} + palette = 12=${base0D} + palette = 13=${base0E} + palette = 14=${base0C} + palette = 15=${base07} - background = ${colors.base00} - foreground = ${colors.base05} - cursor-color = ${colors.base05} - selection-background = ${colors.base02} - selection-foreground = ${colors.base07} - ''; + background = ${base00} + foreground = ${base05} + cursor-color = ${base05} + selection-background = ${base02} + selection-foreground = ${base07} + ''; in symlinkJoin ({ paths = [ghostty]; diff --git a/packages/devkit/lazygit.nix b/packages/devkit/lazygit.nix index a265d41..0be1664 100644 --- a/packages/devkit/lazygit.nix +++ b/packages/devkit/lazygit.nix @@ -21,17 +21,18 @@ symlinkJoin ({ ]; gui.theme = let colors = import ./colors.nix; - in { - activeBorderColor = [colors.base07 "bold"]; - inactiveBorderColor = [colors.base04]; - searchingActiveBorderColor = [colors.base02 "bold"]; - optionsTextColor = [colors.base06]; - selectedLineBgColor = [colors.base03]; - cherryPickedCommitBgColor = [colors.base02]; - cherryPickedCommitFgColor = [colors.base03]; - unstagedChangesColor = [colors.base08]; - defaultFgColor = [colors.base05]; - }; + in + with colors; { + activeBorderColor = [base07 "bold"]; + inactiveBorderColor = [base04]; + searchingActiveBorderColor = [base02 "bold"]; + optionsTextColor = [base06]; + selectedLineBgColor = [base03]; + cherryPickedCommitBgColor = [base02]; + cherryPickedCommitFgColor = [base03]; + unstagedChangesColor = [base08]; + defaultFgColor = [base05]; + }; } // settings))}' '';