mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
alacritty: cleanup
This commit is contained in:
parent
06ce96a246
commit
af509d8484
1 changed files with 22 additions and 14 deletions
|
@ -1,26 +1,38 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
# alacritty.yml is needed in both <current-system>/sw/etc/ and /etc/, or
|
||||
# it won't work correctly in some environments (at least plasma+wayland)
|
||||
# That's why it's in systemPackages AND environment.etc.
|
||||
# (November 2021)
|
||||
|
||||
let
|
||||
cfg = config.sconfig.alacritty;
|
||||
|
||||
configText = builtins.toJSON
|
||||
{
|
||||
env.TERM = "xterm-256color";
|
||||
key_bindings = [
|
||||
{ action = "ScrollHalfPageDown"; mods = "Shift"; key = "PageDown"; }
|
||||
{ action = "ScrollHalfPageUp"; mods = "Shift"; key = "PageUp"; }
|
||||
{ action = "SpawnNewInstance"; mods = "Control|Shift"; key = "N"; }
|
||||
{ action = "SpawnNewInstance"; mods = "Control|Shift"; key = "T"; }
|
||||
];
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
options.sconfig.alacritty.enable = lib.mkEnableOption "Enable Alacritty";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
environment.etc."xdg/alacritty.yml".text = configText;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.alacritty
|
||||
(pkgs.writeTextFile {
|
||||
name = "alacritty.yml";
|
||||
destination = "/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 }
|
||||
- { key: PageUp, mods: Shift, action: ScrollHalfPageUp }
|
||||
- { key: PageDown, mods: Shift, action: ScrollHalfPageDown }
|
||||
'';
|
||||
text = configText;
|
||||
})
|
||||
];
|
||||
|
||||
|
@ -30,9 +42,5 @@ in
|
|||
}
|
||||
[ -z "$VTE_VERSION" ] && PROMPT_COMMAND="_set_title; $PROMPT_COMMAND"
|
||||
'';
|
||||
|
||||
environment.etc."xdg/alacritty.yml".source =
|
||||
"/run/current-system/sw/etc/xdg/alacritty.yml";
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue