Optionalize mkTarget's 'humanName' and 'name' arguments by inferring 'humanName' from the 'name' attribute in the /modules/<MODULE>/meta.nix file, and 'name' from the /modules/<NAME>/ directory name. Inferring the 'humanName' and 'name' arguments ensures consistency and reduces boilerplate. The 'humanName' and 'name' arguments are optionalized instead of removed because complex modules generating target derivations need to distinguish between them. Closes: https://github.com/nix-community/stylix/issues/1661
40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
{ mkTarget, ... }:
|
|
mkTarget {
|
|
config = [
|
|
(
|
|
{ fonts }:
|
|
{
|
|
i18n.inputMethod.fcitx5.settings.addons.classicui.globalSection = with fonts; {
|
|
Font = "${sansSerif.name} ${toString sizes.popups}";
|
|
MenuFont = "${sansSerif.name} ${toString sizes.popups}";
|
|
TrayFont = "${sansSerif.name} ${toString sizes.popups}";
|
|
};
|
|
}
|
|
)
|
|
(
|
|
{ colors }:
|
|
{
|
|
i18n.inputMethod.fcitx5 = {
|
|
settings.addons.classicui.globalSection = {
|
|
Theme = "stylix";
|
|
UseDarkTheme = false;
|
|
UseAccentColor = false;
|
|
};
|
|
themes.stylix = {
|
|
# Adapted from https://github.com/sanweiya/fcitx5-mellow-themes under the BSD 2 license (compatible with this project's license (MIT))
|
|
# Copyright (c) 2024, sanweiya
|
|
highlightImage = colors {
|
|
template = ./highlight.svg.mustache;
|
|
extension = ".svg";
|
|
};
|
|
panelImage = colors {
|
|
template = ./panel.svg.mustache;
|
|
extension = ".svg";
|
|
};
|
|
theme = import ./template.nix { colors = colors.withHashtag; };
|
|
};
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|