nixos-config/home-manager/modules/alacritty/default.nix
Erwin Boskma 4cd0f83ce8
Some checks failed
/ check (push) Failing after 2m46s
Run nixfmt
2024-02-05 11:46:52 +01:00

60 lines
1.3 KiB
Nix

{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.eboskma.programs.alacritty;
importYAML =
name: yamlFile:
(lib.importJSON (
(pkgs.runCommandNoCC name { } ''
mkdir -p $out
${pkgs.yaml2json}/bin/yaml2json < ${yamlFile} | ${pkgs.jq}/bin/jq -a '.' > $out/tmp.json
'').outPath
+ "/tmp.json"
));
theme = importYAML "theme" (
builtins.fetchurl {
url = "https://raw.githubusercontent.com/dracula/alacritty/77aff04b9f2651eac10e5cfa80a3d85ce43e7985/dracula.yml";
sha256 = "NoEBy8cUs6KDfougzAIcuX9oSAltO7y9OOeXJbSQKrY=";
}
);
in
{
options.eboskma.programs.alacritty.enable = mkEnableOption "Enable alacritty";
config = mkIf cfg.enable {
programs.alacritty = {
enable = true;
settings = {
inherit (theme) colors;
window = {
decorations = "full";
startup_mode = "Maximized";
opacity = 0.9;
};
scrolling = {
history = 100000;
};
font = {
normal = {
family = "Iosevka Nerd Font";
style = "Medium";
};
size = 14.0;
};
live_config_reload = true;
mouse = {
hide_when_typing = true;
};
};
};
};
}