diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 0083b661..7001dd41 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1058,6 +1058,13 @@ in A new module is available: 'programs.skim'. ''; } + + { + time = "2019-04-22T12:43:20+00:00"; + message = '' + A new module is available: 'programs.alacritty'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 4822f842..03443912 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -34,6 +34,7 @@ let (loadModule ./misc/version.nix { }) (loadModule ./misc/xdg.nix { }) (loadModule ./programs/afew.nix { }) + (loadModule ./programs/alacritty.nix { }) (loadModule ./programs/alot.nix { }) (loadModule ./programs/astroid.nix { }) (loadModule ./programs/autorandr.nix { }) diff --git a/modules/programs/alacritty.nix b/modules/programs/alacritty.nix new file mode 100644 index 00000000..a4e5e605 --- /dev/null +++ b/modules/programs/alacritty.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.alacritty; + +in + +{ + options = { + programs.alacritty = { + enable = mkEnableOption "Alacritty"; + + settings = mkOption { + type = types.attrs; + default = {}; + example = literalExample '' + { + window.dimensions = { + lines = 3; + columns = 200; + }; + key_bindings = [ + { + key = "K"; + mods = "Control"; + chars = "\\x0c"; + } + ]; + } + ''; + description = '' + Configuration written to + ~/.config/alacritty/alacritty.yml. See + + for the default configuration. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ pkgs.alacritty ]; + + xdg.configFile."alacritty/alacritty.yml".text = + replaceStrings ["\\\\"] ["\\"] (builtins.toJSON cfg.settings); + }; +}