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)
50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
autoload = import ../autoload.nix { inherit lib pkgs; } "hm";
|
|
in
|
|
{
|
|
imports = [
|
|
./cursor.nix
|
|
./icons.nix
|
|
./palette.nix
|
|
../colors.nix
|
|
../cursor.nix
|
|
../fonts.nix
|
|
../icons.nix
|
|
../opacity.nix
|
|
../palette.nix
|
|
../pixel.nix
|
|
../target.nix
|
|
../release.nix
|
|
../overlays.nix
|
|
../ordering.nix
|
|
]
|
|
++ autoload;
|
|
config.warnings =
|
|
lib.mkIf
|
|
(
|
|
config.stylix.enable
|
|
&& config.stylix.enableReleaseChecks
|
|
&& (config.stylix.release != config.home.version.release)
|
|
)
|
|
[
|
|
''
|
|
You are using different Stylix and Home Manager versions. This is
|
|
likely to cause errors and unexpected behavior. It is highly
|
|
recommended that you use a version of Stylix that matches your chosen
|
|
version of Home Manager.
|
|
|
|
If you are willing to accept the risks that come with using
|
|
mismatched versions, you may disable this warning by adding
|
|
|
|
stylix.enableReleaseChecks = false;
|
|
|
|
to your configuration.
|
|
''
|
|
];
|
|
}
|