home: alacritty: setup config

This commit is contained in:
Antoine Martin 2021-04-22 00:25:39 +02:00
parent 36d8b273b7
commit 0e07f901bc
9 changed files with 196 additions and 11 deletions

31
home/alacritty.nix Normal file
View file

@ -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;
};
};
}

View file

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./alacritty.nix
./emacs.nix
./flameshot.nix
./secrets

89
home/themes/alacritty.nix Normal file
View file

@ -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";
};
};
};
}

View file

@ -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; };
};

View file

@ -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 = {};
}

View file

@ -1,4 +1,5 @@
{
i3 = {
background = "#282828";
red = "#cc241d";
green = "#98971a";
@ -9,4 +10,22 @@
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
}

View file

@ -1,3 +1,4 @@
{
i3Theme = import ./i3.nix;
alacrittyTheme = import ./alacritty.nix;
}

View file

@ -1,7 +1,7 @@
let
colors = import ./colors.nix;
in
with colors;
with colors.i3;
{
bar = {
background = background;

View file

@ -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;