summaryrefslogtreecommitdiff
path: root/modules/common/alacritty.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
committerAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
commit91fb4f28ef5d87e8bcf7749928d30ba4a9cbbd34 (patch)
treee07291fcb1cf62a561ffe58d1fd8e2968ff6fcb3 /modules/common/alacritty.nix
parentf1e8dc736a904703eaa97ccf3d5cde3f69101c38 (diff)
2023-02-19
Diffstat (limited to 'modules/common/alacritty.nix')
-rw-r--r--modules/common/alacritty.nix116
1 files changed, 116 insertions, 0 deletions
diff --git a/modules/common/alacritty.nix b/modules/common/alacritty.nix
new file mode 100644
index 0000000..142f6c5
--- /dev/null
+++ b/modules/common/alacritty.nix
@@ -0,0 +1,116 @@
+{
+ config,
+ lib,
+ ...
+}:
+with lib; let
+ cfg = config.nixfiles.modules.alacritty;
+in {
+ options.nixfiles.modules.alacritty.enable =
+ mkEnableOption "Alacritty terminal emulator";
+
+ config = mkIf cfg.enable {
+ hm.programs.alacritty = {
+ enable = true;
+ settings = with config.nixfiles.modules; {
+ window = {
+ padding = with config.fontScheme.monospaceFont; {
+ x = size;
+ y = size;
+ };
+ dynamic_padding = false;
+ decorations = "full";
+ };
+ font = with config.fontScheme.monospaceFont; {
+ normal = {
+ inherit family;
+ style = "Regular";
+ };
+ bold = {
+ inherit family;
+ style = "Bold";
+ };
+ italic = {
+ inherit family;
+ style = "Italic";
+ };
+ bold_italic = {
+ inherit family;
+ style = "Bold Italic";
+ };
+ inherit size;
+ };
+ colors = with config.colourScheme; {
+ primary = {inherit background foreground;};
+ cursor = {
+ text = "CellBackground";
+ cursor = "CellForeground";
+ };
+ vi_mode_cursor = {
+ text = "CellBackground";
+ cursor = "CellForeground";
+ };
+ search = {
+ matches = {
+ foreground = white;
+ background = red;
+ };
+ focused_match = {
+ foreground = red;
+ background = black;
+ };
+ footer_bar = {
+ foreground = black;
+ background = white;
+ };
+ };
+ hints = {
+ start = {
+ foreground = black;
+ background = yellow;
+ };
+ end = {
+ foreground = yellow;
+ background = black;
+ };
+ line_indicator = {
+ foreground = null;
+ background = null;
+ };
+ selection = {
+ text = "CellBackground";
+ background = "CellForeground";
+ };
+ normal = {
+ inherit black red green yellow blue magenta cyan white;
+ };
+ bright = {
+ inherit
+ brightBlack
+ brightRed
+ brightGreen
+ brightYellow
+ brightBlue
+ brightMagenta
+ brightCyan
+ brightWhite
+ ;
+ };
+ };
+ };
+ bell = {
+ duration = 0;
+ command = null; # TODO notify-send?
+ };
+ cursor = {
+ style = {
+ shape = "Block";
+ blinking = "Off";
+ };
+ vi_mode_style = "Block";
+ };
+ selection.save_to_clipboard = true; # TODO autocutsel?
+ };
+ };
+ };
+}