mirror of
https://github.com/danth/stylix
synced 2025-01-06 01:38:44 +00:00
2d59480b45
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
31 lines
787 B
Nix
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 ];
|
|
};
|
|
};
|
|
}
|