From 0e07f901bce32245ee98a30c987c56264039fc30 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 00:25:39 +0200 Subject: [PATCH] home: alacritty: setup config --- home/alacritty.nix | 31 +++++++++ home/default.nix | 1 + home/themes/alacritty.nix | 89 ++++++++++++++++++++++++ home/themes/default.nix | 4 ++ home/themes/solarizedLight/alacritty.nix | 39 +++++++++++ home/themes/solarizedLight/colors.nix | 39 ++++++++--- home/themes/solarizedLight/default.nix | 1 + home/themes/solarizedLight/i3.nix | 2 +- hosts/boreal/home.nix | 1 + 9 files changed, 196 insertions(+), 11 deletions(-) create mode 100644 home/alacritty.nix create mode 100644 home/themes/alacritty.nix create mode 100644 home/themes/solarizedLight/alacritty.nix diff --git a/home/alacritty.nix b/home/alacritty.nix new file mode 100644 index 0000000..7ef12a7 --- /dev/null +++ b/home/alacritty.nix @@ -0,0 +1,31 @@ +{ config, lib, ... }: +let + cfg = config.my.home.alacritty; + alacrittyTheme = config.my.theme.alacrittyTheme; +in +{ + options.my.home.alacritty.enable = lib.mkEnableOption "Alacritty terminal"; + + config.programs.alacritty = lib.mkIf cfg.enable { + enable = true; + + settings = { + window = { + padding = { + x = 8; + y = 8; + }; + decorations = "none"; + }; + + font = { + normal = { + family = "Input Mono Narrow"; + }; + size = 9.0; + }; + + colors = alacrittyTheme; + }; + }; +} diff --git a/home/default.nix b/home/default.nix index 22ffb90..64acc10 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./alacritty.nix ./emacs.nix ./flameshot.nix ./secrets diff --git a/home/themes/alacritty.nix b/home/themes/alacritty.nix new file mode 100644 index 0000000..0e1aeb3 --- /dev/null +++ b/home/themes/alacritty.nix @@ -0,0 +1,89 @@ +{ lib }: +with lib; +let + mkColorOption = import ./color.nix { inherit lib; }; + + primaryColorModule = types.submodule { + options = { + background = mkColorOption {}; + foreground = mkColorOption {}; + }; + }; + + cursorColorModule = types.submodule { + options = { + text = mkColorOption {}; + cursor = mkColorOption {}; + }; + }; + + rainbowColorModule = types.submodule { + options = { + black = mkColorOption {}; + red = mkColorOption {}; + green = mkColorOption {}; + yellow = mkColorOption {}; + blue = mkColorOption {}; + magenta = mkColorOption {}; + cyan = mkColorOption {}; + white = mkColorOption {}; + }; + }; +in +types.submodule { + options = { + primary = mkOption { + type = primaryColorModule; + default = { + foreground = "#c5c8c6"; + background = "#1d1f21"; + }; + }; + cursor = mkOption { + type = cursorColorModule; + default = { + text = "#1d1f21"; + cursor = "#c5c8c6"; + }; + }; + normal = mkOption { + type = rainbowColorModule; + default = { + black = "#1d1f21"; + red = "#cc6666"; + green = "#b5bd68"; + yellow = "#f0c674"; + blue = "#81a2be"; + magenta = "#b294bb"; + cyan = "#8abeb7"; + white = "#c5c8c6"; + }; + }; + bright = mkOption { + type = rainbowColorModule; + default = { + black = "#666666"; + red = "#d54e53"; + green = "#b9ca4a"; + yellow = "#e7c547"; + blue = "#7aa6da"; + magenta = "#c397d8"; + cyan = "#70c0b1"; + white = "#eaeaea"; + }; + }; + dim = mkOption { + type = rainbowColorModule; + default = { + black = "#131415"; + red = "#864343"; + green = "#777c44"; + yellow = "#9e824c"; + blue = "#556a7d"; + magenta = "#75617b"; + cyan = "#5b7d78"; + white = "#828482"; + }; + }; + }; +} diff --git a/home/themes/default.nix b/home/themes/default.nix index 0ee7404..9911106 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -3,6 +3,10 @@ with lib; let themeType = types.submodule { options = { + alacrittyTheme = mkOption { + type = import ./alacritty.nix { inherit lib; }; + default = {}; + }; i3Theme = mkOption { type = import ./i3.nix { inherit lib; }; }; diff --git a/home/themes/solarizedLight/alacritty.nix b/home/themes/solarizedLight/alacritty.nix new file mode 100644 index 0000000..9f2149f --- /dev/null +++ b/home/themes/solarizedLight/alacritty.nix @@ -0,0 +1,39 @@ +let + colors = import ./colors.nix; +in +with colors; +{ + primary = { + background = base3; + foreground = base00; + }; + + cursor = { + text = base3; + cursor = base00; + }; + + normal = { + black = base02; + red = red; + green = green; + yellow = yellow; + blue = blue; + magenta = magenta; + cyan = cyan; + white = base2; + }; + + bright = { + black = base03; + red = orange; + green = base01; + yellow = base00; + blue = base0; + magenta = violet; + cyan = base1; + white = base3; + }; + + dim = {}; +} diff --git a/home/themes/solarizedLight/colors.nix b/home/themes/solarizedLight/colors.nix index 7c7f771..e5cac20 100644 --- a/home/themes/solarizedLight/colors.nix +++ b/home/themes/solarizedLight/colors.nix @@ -1,12 +1,31 @@ { - background = "#282828"; - red = "#cc241d"; - green = "#98971a"; - yellow = "#d79921"; - blue = "#458588"; - purple = "#b16286"; - aqua = "#689d68"; - gray = "#a89984"; - darkGray = "#1d2021"; - white = "#ffffff"; + i3 = { + background = "#282828"; + red = "#cc241d"; + green = "#98971a"; + yellow = "#d79921"; + blue = "#458588"; + purple = "#b16286"; + aqua = "#689d68"; + gray = "#a89984"; + darkGray = "#1d2021"; + white = "#ffffff"; + }; + + base03 = "#002b36"; # brblack + base02 = "#073642"; # black + base01 = "#586e75"; # brgreen + base00 = "#657b83"; # bryellow + base0 = "#839496"; # brblue + base1 = "#93a1a1"; # brcyan + base2 = "#eee8d5"; # white + base3 = "#fdf6e3"; # brwhite + yellow = "#b58900"; # yellow + orange = "#cb4b16"; # brred + red = "#dc322f"; # red + magenta = "#d33682"; # magenta + violet = "#6c71c4"; # brmagenta + blue = "#268bd2"; # blue + cyan = "#2aa198"; # cyan + green = "#859900"; # green } diff --git a/home/themes/solarizedLight/default.nix b/home/themes/solarizedLight/default.nix index f0646f6..299fec1 100644 --- a/home/themes/solarizedLight/default.nix +++ b/home/themes/solarizedLight/default.nix @@ -1,3 +1,4 @@ { i3Theme = import ./i3.nix; + alacrittyTheme = import ./alacritty.nix; } diff --git a/home/themes/solarizedLight/i3.nix b/home/themes/solarizedLight/i3.nix index 75399b3..69a9982 100644 --- a/home/themes/solarizedLight/i3.nix +++ b/home/themes/solarizedLight/i3.nix @@ -1,7 +1,7 @@ let colors = import ./colors.nix; in -with colors; +with colors.i3; { bar = { background = background; diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index 623800a..b178f61 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -4,6 +4,7 @@ # Keyboard settings & i3 settings my.home.x.enable = true; my.home.x.cursor.enable = true; + my.home.alacritty.enable = true; my.home.emacs.enable = true; my.home.tmux.enable = true; my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight;