aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/programs/alacritty.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/modules/programs/alacritty.nix')
-rw-r--r--home-manager/modules/programs/alacritty.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/home-manager/modules/programs/alacritty.nix b/home-manager/modules/programs/alacritty.nix
new file mode 100644
index 00000000000..84675cb1c8a
--- /dev/null
+++ b/home-manager/modules/programs/alacritty.nix
@@ -0,0 +1,53 @@
+{ 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
+ <filename>~/.config/alacritty/alacritty.yml</filename>. See
+ <link xlink:href="https://github.com/jwilm/alacritty/blob/master/alacritty.yml"/>
+ for the default configuration.
+ '';
+ };
+ };
+ };
+
+ config = mkMerge [
+ (mkIf cfg.enable {
+ home.packages = [ pkgs.alacritty ];
+
+ xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != {}) {
+ text = replaceStrings ["\\\\"] ["\\"] (builtins.toJSON cfg.settings);
+ };
+ })
+ ];
+}