From 21e4c5b10dff260c1e5daceb8f78d09e344ec86f Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 7 Jul 2025 04:15:28 -0700 Subject: [PATCH] switch back to alacritty --- README.md | 2 +- home-manager/gui.nix | 3 +- home-manager/progs/alacritty.nix | 131 +++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 home-manager/progs/alacritty.nix diff --git a/README.md b/README.md index 933dc87..64cc642 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Browser: Firefox 🦊 (actually [Zen Browser](https://github.com/zen-browser/des Text Editor: [Doom Emacs](https://github.com/doomemacs/doomemacs) -Terminal: [ghostty](https://github.com/ghostty-org/ghostty) +Terminal: [alacritty](https://github.com/alacritty/alacritty) Shell: [fish](https://fishshell.com/) with the [pure](https://github.com/pure-fish/pure) prompt diff --git a/home-manager/gui.nix b/home-manager/gui.nix index 5b4d321..0dce8d1 100644 --- a/home-manager/gui.nix +++ b/home-manager/gui.nix @@ -7,7 +7,8 @@ { imports = [ ./no-gui.nix - ./progs/ghostty.nix + # ./progs/ghostty.nix + ./progs/alacritty.nix ./progs/emacs.nix # ./progs/trezor.nix # - broken ]; diff --git a/home-manager/progs/alacritty.nix b/home-manager/progs/alacritty.nix new file mode 100644 index 0000000..63484a2 --- /dev/null +++ b/home-manager/progs/alacritty.nix @@ -0,0 +1,131 @@ +{ pkgs, ... }: +{ + home.sessionVariables = { + TERMINAL = "alacritty"; + }; + + programs.alacritty = { + enable = true; + package = pkgs.alacritty; + settings = { + # some programs can't handle alacritty + env.TERM = "xterm-256color"; + + window = { + # using a window manager, no decorations needed + decorations = "none"; + + # semi-transparent + opacity = 0.90; + + # padding between the content of the terminal and the edge + padding = { + x = 10; + y = 10; + }; + + dimensions = { + columns = 80; + lines = 40; + }; + }; + + scrolling = { + history = 1000; + multiplier = 3; + }; + + font = + let + baseFont = { + family = "JetBrains Mono Nerd Font"; + style = "Regular"; + }; + in + { + size = 12; + + normal = baseFont; + + bold = baseFont // { + style = "Bold"; + }; + + italic = baseFont // { + style = "Italic"; + }; + + offset.y = 0; + glyph_offset.y = 0; + }; + + # color scheme + colors = + let + normal = { + black = "0x1b1e28"; + red = "0xd0679d"; + green = "0x5de4c7"; + yellow = "0xfffac2"; + blue = "#435c89"; + magenta = "0xfcc5e9"; + cyan = "0xadd7ff"; + white = "0xffffff"; + }; + + bright = { + black = "0xa6accd"; + red = normal.red; + green = normal.green; + yellow = normal.yellow; + blue = normal.cyan; + magenta = "0xfae4fc"; + cyan = "0x89ddff"; + white = normal.white; + }; + in + { + inherit normal bright; + primary = { + background = "0x131621"; + foreground = bright.black; + }; + + cursor = { + text = "CellBackground"; + cursor = "CellForeground"; + }; + + search = + let + foreground = normal.black; + background = normal.cyan; + in + { + matches = { + inherit foreground background; + }; + + focused_match = { + inherit foreground background; + }; + }; + + selection = { + text = "CellForeground"; + background = "0x303340"; + }; + + vi_mode_cursor = { + text = "CellBackground"; + cursor = "CellForeground"; + }; + }; + + cursor = { + style = "Underline"; + vi_mode_style = "Underline"; + }; + }; + }; +}