2024-10-18 04:10:30 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2024-06-24 04:10:59 +00:00
|
|
|
|
|
|
|
let
|
2024-10-18 04:10:30 +00:00
|
|
|
aconfig = (pkgs.formats.toml { }).generate "alacritty.toml"
|
2024-06-24 04:10:59 +00:00
|
|
|
{
|
|
|
|
env.TERM = "xterm-256color";
|
|
|
|
font.size = 12;
|
|
|
|
window = {
|
|
|
|
dynamic_padding = true;
|
|
|
|
resize_increments = true;
|
|
|
|
dimensions = { columns = 120; lines = 40; };
|
|
|
|
};
|
|
|
|
keyboard.bindings = [
|
|
|
|
{ action = "ScrollHalfPageDown"; mods = "Shift"; key = "PageDown"; }
|
|
|
|
{ action = "ScrollHalfPageUp"; mods = "Shift"; key = "PageUp"; }
|
2024-07-09 05:55:37 +00:00
|
|
|
{ action = "SpawnNewInstance"; mods = "Control|Shift"; key = "N"; }
|
|
|
|
{ action = "SpawnNewInstance"; mods = "Control|Shift"; key = "T"; }
|
2024-06-24 04:10:59 +00:00
|
|
|
];
|
|
|
|
colors = {
|
|
|
|
primary.background = "0x1e1e1e";
|
|
|
|
primary.foreground = "0xffffff";
|
|
|
|
};
|
2024-11-05 01:48:37 +00:00
|
|
|
general.import = [ "${pkgs.alacritty-theme}/tango_dark.toml" ];
|
2024-06-24 04:10:59 +00:00
|
|
|
};
|
|
|
|
|
2024-06-24 05:01:38 +00:00
|
|
|
# Alacritty seems to not communicate well with gnome-shell. Quick fix:
|
|
|
|
notify-fix = pkgs.runCommand "alacritty-fix" { } ''
|
|
|
|
dt=share/applications/Alacritty.desktop
|
|
|
|
install -D ${pkgs.alacritty}/$dt $out/$dt
|
|
|
|
sed -i 's/^StartupNotify=.*//' $out/$dt
|
|
|
|
'';
|
|
|
|
|
2024-06-24 04:10:59 +00:00
|
|
|
in
|
|
|
|
{
|
2024-10-18 04:10:30 +00:00
|
|
|
config = lib.mkIf (config.sconfig.desktop.enable) {
|
|
|
|
environment.etc."xdg/alacritty.toml".source = aconfig;
|
|
|
|
environment.systemPackages = [
|
|
|
|
(lib.hiPrio notify-fix)
|
|
|
|
pkgs.alacritty
|
|
|
|
];
|
|
|
|
};
|
2024-06-24 04:10:59 +00:00
|
|
|
}
|