2019-03-10 23:45:49 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.alacritty;
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
2019-03-10 23:45:49 +00:00
|
|
|
options = {
|
|
|
|
programs.alacritty = {
|
|
|
|
enable = mkEnableOption "Alacritty";
|
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = types.attrs;
|
2020-02-01 23:39:17 +00:00
|
|
|
default = { };
|
2019-03-10 23:45:49 +00:00
|
|
|
example = literalExample ''
|
|
|
|
{
|
|
|
|
window.dimensions = {
|
|
|
|
lines = 3;
|
|
|
|
columns = 200;
|
|
|
|
};
|
|
|
|
key_bindings = [
|
|
|
|
{
|
|
|
|
key = "K";
|
|
|
|
mods = "Control";
|
|
|
|
chars = "\\x0c";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
description = ''
|
|
|
|
Configuration written to
|
|
|
|
<filename>~/.config/alacritty/alacritty.yml</filename>. See
|
|
|
|
<link xlink:href="https://github.com/jwilm/alacritty/blob/master/alacritty.yml"/>
|
|
|
|
for the default configuration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-05-13 02:08:23 +00:00
|
|
|
config = mkMerge [
|
|
|
|
(mkIf cfg.enable {
|
|
|
|
home.packages = [ pkgs.alacritty ];
|
2019-03-10 23:45:49 +00:00
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != { }) {
|
|
|
|
text =
|
|
|
|
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings);
|
2019-05-13 02:08:23 +00:00
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
2019-03-10 23:45:49 +00:00
|
|
|
}
|