home: terminal: add alacritty

This commit is contained in:
Bruno BELANYI 2023-02-12 16:46:49 +00:00
parent b6bbe5a01e
commit f89e10fdca
2 changed files with 59 additions and 1 deletions

View file

@ -0,0 +1,57 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.terminal;
in
{
config = lib.mkIf (cfg.program == "alacritty") {
programs.alacritty = {
enable = true;
settings = {
env = {
# DPI scaling means the font is way too big otherwise
WINIT_X11_SCALE_FACTOR = "1.0";
};
font = {
size = 9;
};
colors = {
primary = {
background = cfg.colors.background;
foreground = cfg.colors.foreground;
bright_foreground = cfg.colors.foregroundBold;
};
cursor = {
cursor = cfg.colors.cursor;
};
normal = {
black = cfg.colors.black;
red = cfg.colors.red;
green = cfg.colors.green;
yellow = cfg.colors.yellow;
blue = cfg.colors.blue;
magenta = cfg.colors.magenta;
cyan = cfg.colors.cyan;
white = cfg.colors.white;
};
bright = {
black = cfg.colors.blackBold;
red = cfg.colors.redBold;
green = cfg.colors.greenBold;
yellow = cfg.colors.yellowBold;
blue = cfg.colors.blueBold;
magenta = cfg.colors.magentaBold;
cyan = cfg.colors.cyanBold;
white = cfg.colors.whiteBold;
};
};
};
};
};
}

View file

@ -10,13 +10,14 @@ let
in in
{ {
imports = [ imports = [
./alacritty
./termite ./termite
]; ];
options.my.home = with lib; { options.my.home = with lib; {
terminal = { terminal = {
program = mkOption { program = mkOption {
type = with types; nullOr (enum [ "termite" ]); type = with types; nullOr (enum [ "alacritty" "termite" ]);
default = null; default = null;
example = "termite"; example = "termite";
description = "Which terminal to use for home session"; description = "Which terminal to use for home session";