devos/users/modules/alacritty/default.nix

84 lines
2 KiB
Nix
Raw Permalink Normal View History

2022-09-19 15:41:22 +02:00
{ pkgs, lib, config, ... }:
let
cfg = config.mae.alacritty;
alacrittyLibGL = pkgs.symlinkJoin {
name = "alacritty-nixgl";
paths = [
(pkgs.writeShellScriptBin
2022-09-23 00:05:26 +02:00
"alacritty"
''
${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ${pkgs.alacritty}/bin/alacritty "$@"
'')
2022-09-19 15:41:22 +02:00
pkgs.alacritty
];
};
in
{
options.mae.alacritty = {
enable = lib.mkEnableOption "Enable the alacritty terminal";
2022-09-19 15:51:26 +02:00
libglWrapper = lib.mkOption {
default = false;
type = lib.types.bool;
description = "Wrap alacritty in libgl to make it work on non nixos systems";
};
2022-09-19 15:41:22 +02:00
};
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = true;
home.packages = [
(pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
programs.alacritty = {
package = lib.mkIf cfg.libglWrapper alacrittyLibGL;
enable = true;
settings = {
window = {
padding = {
x = 6;
y = 6;
};
};
font = {
normal = {
family = "JetBrainsMono Nerd Font";
};
size = 12;
};
colors = {
primary = {
background = "#161821";
foreground = "#d2d4de";
};
normal = {
black = "#161821";
red = "#e27878";
green = "#b4be82";
yellow = "#e2a478";
blue = "#84a0c6";
magenta = "#a093c7";
cyan = "#89b8c2";
white = "#c6c8d1";
};
bright = {
black = "#6b7089";
red = "#e98989";
green = "#c0ca8e";
yellow = "#e9b189";
blue = "#91acd1";
magenta = "#ada0d3";
cyan = "#95c4ce";
white = "#d2d4de";
};
};
cursor = {
style = "Block";
blinking = "On";
};
live_config_reload = false;
mouse = {
hide_when_typing = false;
};
};
};
};
}