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
(cherry picked from commit dfc859f54d)
46 lines
1.5 KiB
Nix
46 lines
1.5 KiB
Nix
{ mkTarget, ... }:
|
|
mkTarget {
|
|
# Adapted from https://www.nushell.sh/book/coloring_and_theming.html#theming
|
|
config =
|
|
{ colors }:
|
|
{
|
|
programs.nushell.extraConfig = with colors.withHashtag; ''
|
|
$env.config.color_config = {
|
|
separator: "${base03}"
|
|
leading_trailing_space_bg: "${base04}"
|
|
header: "${base0B}"
|
|
date: "${base0E}"
|
|
filesize: "${base0D}"
|
|
row_index: "${base0C}"
|
|
bool: "${base08}"
|
|
int: "${base0B}"
|
|
duration: "${base08}"
|
|
range: "${base08}"
|
|
float: "${base08}"
|
|
string: "${base04}"
|
|
nothing: "${base08}"
|
|
binary: "${base08}"
|
|
cellpath: "${base08}"
|
|
hints: dark_gray
|
|
|
|
shape_garbage: { fg: "${base07}" bg: "${base08}" }
|
|
shape_bool: "${base0D}"
|
|
shape_int: { fg: "${base0E}" attr: b }
|
|
shape_float: { fg: "${base0E}" attr: b }
|
|
shape_range: { fg: "${base0A}" attr: b }
|
|
shape_internalcall: { fg: "${base0C}" attr: b }
|
|
shape_external: "${base0C}"
|
|
shape_externalarg: { fg: "${base0B}" attr: b }
|
|
shape_literal: "${base0D}"
|
|
shape_operator: "${base0A}"
|
|
shape_signature: { fg: "${base0B}" attr: b }
|
|
shape_string: "${base0B}"
|
|
shape_filepath: "${base0D}"
|
|
shape_globpattern: { fg: "${base0D}" attr: b }
|
|
shape_variable: "${base0E}"
|
|
shape_flag: { fg: "${base0D}" attr: b }
|
|
shape_custom: { attr: b }
|
|
}
|
|
'';
|
|
};
|
|
}
|