From 22924de88274e192df0970f70ec631660583bf17 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 27 Jun 2025 00:08:44 -0400 Subject: add alacritty --- modules/terminal/alacritty.nix | 74 ++++++++++++++++++++++++++++++++++++++++++ modules/terminal/default.nix | 2 ++ 2 files changed, 76 insertions(+) create mode 100644 modules/terminal/alacritty.nix (limited to 'modules/terminal') diff --git a/modules/terminal/alacritty.nix b/modules/terminal/alacritty.nix new file mode 100644 index 0000000..7dd4456 --- /dev/null +++ b/modules/terminal/alacritty.nix @@ -0,0 +1,74 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.terminal; +in { + config = mkIf cfg.alacritty { + default.terminal = lib.mkDefault "alacritty"; + + home-manager.users.${config.user} = { + programs.alacritty = { + enable = true; + + settings = { + # Font + font = { + size = 11; + bold = { + style = "Bold"; + }; + bold_italic = { + style = "Bold Italic"; + }; + italic = { + style = "Italic"; + }; + normal = { + family = config.theme.font.monospace; + style = "Regular"; + }; + offset = { + x = 0; + y = 0; + }; + }; + + # Window + window = { + decorations = "full"; + dynamic_title = true; + padding = { + x = config.theme.outerGap; + y = config.theme.outerGap; + }; + opacity = config.theme.opacity; + }; + + # Colors + colors = + (lib.attrsets.mapAttrs ( + group: colors: + lib.attrsets.mapAttrs (name: color: "#${color}") colors + ) {inherit (config.theme.colors) bright normal;}) + // { + cursor = { + background = "CellForeground"; + text = "CellBackground"; + }; + selection = { + background = "CellForeground"; + text = "CellBackground"; + }; + primary = { + foreground = "#${config.theme.colors.fg}"; + background = "#${config.theme.colors.bg}"; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/terminal/default.nix b/modules/terminal/default.nix index 8e9d5f8..8d97a01 100644 --- a/modules/terminal/default.nix +++ b/modules/terminal/default.nix @@ -6,10 +6,12 @@ inherit (lib) mkEnableOption; in { imports = [ + ./alacritty.nix ./kitty.nix ]; options.terminal = { + alacritty = mkEnableOption "Enable the alacritty terminal."; kitty = mkEnableOption "Enable the kitty terminal."; }; } -- cgit v1.2.3-freya