nixos-config/modules/alacritty.nix

31 lines
883 B
Nix
Raw Normal View History

2021-08-31 22:21:37 +00:00
{ config, pkgs, lib, ... }:
2021-09-08 00:32:11 +00:00
let
cfg = config.sconfig.alacritty;
in
2021-08-31 22:21:37 +00:00
{
2021-09-08 00:32:11 +00:00
options.sconfig.alacritty.enable = lib.mkEnableOption "Enable Alacritty";
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.alacritty ];
2021-08-31 22:21:37 +00:00
programs.bash.interactiveShellInit = ''
function _set_title() {
printf "\033]0;%s@%s:%s\007" "''${USER}" "''${HOSTNAME%%.*}" "''${PWD/#$HOME/\~}"
}
[ -z "$VTE_VERSION" ] && PROMPT_COMMAND="_set_title; $PROMPT_COMMAND"
'';
environment.etc."xdg/alacritty.yml".text = ''
env:
TERM: xterm-256color
key_bindings:
- { key: N, mods: Control|Shift, action: SpawnNewInstance }
- { key: T, mods: Control|Shift, action: SpawnNewInstance }
2021-09-06 06:09:59 +00:00
- { key: PageUp, mods: Shift, action: ScrollHalfPageUp }
- { key: PageDown, mods: Shift, action: ScrollHalfPageDown }
2021-08-31 22:21:37 +00:00
'';
};
}