2023-06-18 00:46:31 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
proj_root,
|
|
|
|
myLib,
|
|
|
|
...
|
|
|
|
}: let
|
2022-12-11 00:00:49 +00:00
|
|
|
inherit (myLib) fromYaml;
|
2022-12-26 10:42:14 +00:00
|
|
|
actualConfig = fromYaml (builtins.readFile "${proj_root.config.path}//alacritty/alacritty.yml");
|
2022-12-11 00:00:49 +00:00
|
|
|
cfg = config.base.alacritty;
|
2023-06-18 00:46:31 +00:00
|
|
|
in {
|
|
|
|
options.base.alacritty = {
|
|
|
|
font.family = myLib.mkOption {
|
|
|
|
type = myLib.types.singleLineStr;
|
|
|
|
default = actualConfig.font.normal.family;
|
|
|
|
description = ''
|
|
|
|
The font family for Alacritty
|
|
|
|
'';
|
|
|
|
example = "DroidSansMono NF";
|
|
|
|
};
|
|
|
|
font.size = myLib.mkOption {
|
|
|
|
type = myLib.types.number;
|
|
|
|
default = actualConfig.font.size;
|
|
|
|
description = ''
|
|
|
|
The default font size for Alacritty. This is probably measured in px.
|
|
|
|
'';
|
|
|
|
example = 7.0;
|
|
|
|
};
|
|
|
|
enable = myLib.mkOption {
|
|
|
|
type = myLib.types.bool;
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
Enables alacritty
|
|
|
|
'';
|
|
|
|
example = true;
|
2022-12-14 20:39:13 +00:00
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
_actualConfig = myLib.mkOption {
|
|
|
|
type = myLib.types.attrs;
|
|
|
|
visible = false;
|
|
|
|
default = actualConfig;
|
|
|
|
description = "underlying default config";
|
|
|
|
};
|
|
|
|
additionalConfigPath = myLib.mkOption {
|
|
|
|
type = myLib.types.nullOr myLib.types.path;
|
|
|
|
visible = false;
|
|
|
|
default = null;
|
|
|
|
description = "impurely write our alacritty.yml to this path";
|
|
|
|
};
|
|
|
|
};
|
2022-12-11 00:00:49 +00:00
|
|
|
|
|
|
|
config.programs.alacritty = {
|
|
|
|
enable = cfg.enable;
|
2022-12-13 18:42:17 +00:00
|
|
|
settings = myLib.recursiveUpdate actualConfig {
|
2022-12-11 00:00:49 +00:00
|
|
|
font.normal.family = cfg.font.family;
|
2023-01-14 14:37:40 +00:00
|
|
|
font.size = cfg.font.size;
|
2022-12-11 00:00:49 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|