From 493923a756834f6b33897670684ca5a197d74955 Mon Sep 17 00:00:00 2001
From: Tim Keller <tjkeller.xyz>
Date: Wed, 30 Oct 2024 19:29:12 -0500
Subject: add alacritty config to home manager

---
 modules/home/alacritty.nix  | 67 +++++++++++++++++++++++++++++++++++++++++++++
 modules/home/default.nix    |  2 ++
 modules/hosts/T430/home.nix |  2 ++
 3 files changed, 71 insertions(+)
 create mode 100644 modules/home/alacritty.nix

diff --git a/modules/home/alacritty.nix b/modules/home/alacritty.nix
new file mode 100644
index 0000000..f60fe01
--- /dev/null
+++ b/modules/home/alacritty.nix
@@ -0,0 +1,67 @@
+{ config, lib, ... }: {
+	options = {
+		alacritty = {
+			enable = lib.mkEnableOption "enables creation of alacritty config file";
+			font.size = lib.mkOption {
+				type = lib.types.int;
+				default = 12;
+			};
+			font.family = lib.mkOption {
+				type = lib.types.str;
+				default = "JetBrainsMonoNL Nerd Font Mono";
+			};
+		};
+	};
+
+	config = {
+		programs.alacritty.enable = config.alacritty.enable;
+		programs.alacritty.settings = lib.mkIf config.alacritty.enable {
+			colors = {
+				bright = {
+					black   = "#7f7f7f";
+					blue    = "#1578c1";
+					cyan    = "#00c4a3";
+					green   = "#2bb500";
+					magenta = "#b14ff7";
+					red     = "#ed1207";
+					white   = "#ffffff";
+					yellow  = "#fc9700";
+				};
+				normal = {
+					black   = "#101010";
+					blue    = "#1578c1";
+					cyan    = "#00c4a3";
+					green   = "#2bb500";
+					magenta = "#b14ff7";
+					red     = "#ed1207";
+					white   = "#ffffff";
+					yellow  = "#fc9700";
+				};
+				primary = {
+					background = "#101010";
+					foreground = "#ffffff";
+				};
+			};
+			cursor.style.blinking = "Never";
+			env.TERM = "xterm-256color";
+			font = {
+				size = config.alacritty.font.size;
+				normal.family = config.alacritty.font.family;
+			};
+			mouse.bindings = [{
+				action = "PasteSelection";
+				mouse = "Right";
+			}];
+			window = {
+				dynamic_padding = true;
+				dynamic_title = true;
+				title = "Terminal";
+				# Pretend to be st
+				class = {
+					general = "st";
+					instance = "st";
+				};
+			};
+		};
+	};
+}
diff --git a/modules/home/default.nix b/modules/home/default.nix
index a883234..2c19b8c 100644
--- a/modules/home/default.nix
+++ b/modules/home/default.nix
@@ -6,6 +6,7 @@
 	};
 
 	imports = [
+		./alacritty.nix
 		./firefox.nix
 		./git.nix
 		./initial-home-setup.nix
@@ -13,5 +14,6 @@
 		./theme.nix
 	];
 
+	alacritty.enable  = lib.mkDefault true;
 	theme.mint.enable = lib.mkDefault true;
 }
diff --git a/modules/hosts/T430/home.nix b/modules/hosts/T430/home.nix
index a04b93f..1e5b3d1 100644
--- a/modules/hosts/T430/home.nix
+++ b/modules/hosts/T430/home.nix
@@ -1,3 +1,5 @@
 { ... }: {
 	imports = [ ../../home ];
+
+	alacritty.font.size = 9;
 }
-- 
cgit v1.2.3