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
47 lines
1.4 KiB
Nix
47 lines
1.4 KiB
Nix
{
|
|
mkTarget,
|
|
lib,
|
|
options,
|
|
pkgs,
|
|
...
|
|
}:
|
|
mkTarget {
|
|
config =
|
|
{ colors }:
|
|
lib.optionalAttrs (options.programs ? spicetify) {
|
|
programs.spicetify = {
|
|
theme = {
|
|
name = "stylix";
|
|
src = pkgs.writeTextFile {
|
|
name = "color.ini";
|
|
destination = "/color.ini";
|
|
text = with colors; ''
|
|
[base]
|
|
text = ${base05}
|
|
subtext = ${base05}
|
|
main = ${base00}
|
|
main-elevated = ${base02}
|
|
highlight = ${base02}
|
|
highlight-elevated = ${base03}
|
|
sidebar = ${base01}
|
|
player = ${base04}
|
|
card = ${base03}
|
|
shadow = ${base00}
|
|
selected-row = ${base04}
|
|
button = ${base04}
|
|
button-active = ${base04}
|
|
button-disabled = ${base03}
|
|
tab-active = ${base02}
|
|
notification = ${base02}
|
|
notification-error = ${base08}
|
|
equalizer = ${base0B}
|
|
misc = ${base02}
|
|
'';
|
|
};
|
|
# Sidebar configuration is incompatible with the default navigation bar
|
|
sidebarConfig = false;
|
|
};
|
|
colorScheme = "base";
|
|
};
|
|
};
|
|
}
|