Link: https://github.com/nix-community/stylix/pull/2041 Link: https://github.com/nix-community/stylix/pull/1976#discussion_r2539186937 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{
|
|
mkTarget,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
mkTarget {
|
|
name = "helix";
|
|
humanName = "Helix";
|
|
|
|
extraOptions.transparent = lib.mkEnableOption "transparent theming" // {
|
|
internal = true;
|
|
default = false;
|
|
};
|
|
|
|
configElements = [
|
|
(
|
|
{ opacity }:
|
|
{
|
|
stylix.targets.helix.transparent = opacity.terminal != 1.0;
|
|
}
|
|
)
|
|
(
|
|
{
|
|
cfg,
|
|
colors,
|
|
inputs,
|
|
}:
|
|
{
|
|
programs.helix = {
|
|
settings.theme = "stylix";
|
|
|
|
themes.stylix =
|
|
let
|
|
theme = colors { templateRepo = inputs.base16-helix; };
|
|
|
|
# Removing the background exposes transparency from the terminal. The
|
|
# background might be helpful if the terminal isn't themed, so we only
|
|
# do this if transparency is actually enabled.
|
|
transparentTheme = pkgs.runCommandLocal "helix-transparent.toml" { } ''
|
|
sed 's/,\? bg = "base00"//g' <${theme} >$out
|
|
'';
|
|
in
|
|
if cfg.transparent then transparentTheme else theme;
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|