1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/alacritty.nix

69 lines
1.8 KiB
Nix
Raw Normal View History

2021-04-07 09:37:57 +02:00
{
2022-03-10 21:52:12 +01:00
pkgs,
lib,
config,
...
2022-05-10 20:52:07 +02:00
}: let
alacritty-cfg = theme:
(pkgs.formats.yaml {}).generate "alacritty.yml" {
2022-11-30 12:39:45 +01:00
window.opacity = 0.99;
2022-12-17 10:03:15 +01:00
bell = {
animation = "EaseOut";
duration = 100;
color = "#ffffff";
};
2021-04-07 09:37:57 +02:00
font = {
normal.family = "Monospace";
size = 6;
};
2022-05-10 20:52:07 +02:00
live_config_reload = true;
2021-04-07 09:37:57 +02:00
key_bindings = [
{
2021-06-01 19:14:00 +02:00
key = "Plus";
2021-04-07 09:37:57 +02:00
mods = "Control";
action = "IncreaseFontSize";
}
{
key = "Minus";
mods = "Control";
action = "DecreaseFontSize";
}
{
key = "Key0";
mods = "Control";
action = "ResetFontSize";
}
];
2022-05-10 20:52:07 +02:00
colors = let
colourNames = ["black" "red" "green" "yellow" "blue" "magenta" "cyan" "white"];
colourPairs = lib.getAttrs colourNames theme;
in {
primary = {inherit (theme) background foreground;};
cursor = {inherit (theme) cursor;};
2022-05-10 20:52:07 +02:00
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
};
2021-04-07 09:37:57 +02:00
};
2022-05-10 20:52:07 +02:00
alacritty-pkg = pkgs.symlinkJoin {
name = "alacritty";
paths = [
(pkgs.writeDashBin "alacritty" ''
${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml msg create-window "$@" ||
${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml "$@"
2022-05-10 20:52:07 +02:00
'')
pkgs.alacritty
];
};
in {
environment.variables.TERMINAL = "alacritty";
environment.systemPackages = [
alacritty-pkg
];
environment.etc = {
2022-12-13 14:12:40 +01:00
"themes/dark/alacritty.yml".source = alacritty-cfg (import <niveum/lib/colours/papercolor-dark.nix>);
"themes/light/alacritty.yml".source = alacritty-cfg (import <niveum/lib/colours/papercolor-light.nix>);
2020-05-31 18:23:08 +02:00
};
2019-09-24 23:16:08 +02:00
}