stylix/modules/alacritty/hm.nix
xokdvium 2d59480b45
alacritty: Use TOML template for recent versions (#219)
Since version 0.13.0 alacritty has switched to TOML config
file format. For backwards compatibility this patch implements conditional
template format depending on the package version.

Closes #214
2024-01-17 15:12:55 +00:00

31 lines
787 B
Nix

{pkgs, config, lib, ... }:
with config.stylix.fonts;
let
useYaml = (builtins.compareVersions config.programs.alacritty.package.version "0.13.0") < 0;
templateRepo = config.lib.stylix.templates.
"base16-alacritty${if useYaml then "-yaml" else ""}";
themeFile = config.lib.stylix.colors {
inherit templateRepo;
};
in
{
options.stylix.targets.alacritty.enable =
config.lib.stylix.mkEnableTarget "Alacritty" true;
config = lib.mkIf config.stylix.targets.alacritty.enable {
programs.alacritty.settings = {
font = {
normal = {
family = monospace.name;
style = "Regular";
};
size = sizes.terminal;
};
window.opacity = with config.stylix.opacity; terminal;
import = [ themeFile ];
};
};
}