fontconfig: leverage lib.genAttrs and use mkOrder (#1718)
Link: https://github.com/nix-community/stylix/pull/1718 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> Reviewed-by: awwpotato <awwpotato@voidq.com> Reviewed-by: Flameopathic <64027365+Flameopathic@users.noreply.github.com>
This commit is contained in:
commit
2567b92466
6 changed files with 25 additions and 7 deletions
|
|
@ -1,16 +1,17 @@
|
|||
{ mkTarget }:
|
||||
{ lib, ... }:
|
||||
mkTarget {
|
||||
name = "fontconfig";
|
||||
humanName = "Fontconfig";
|
||||
|
||||
configElements =
|
||||
{ fonts }:
|
||||
{ listTargetIndex, fonts }:
|
||||
{
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
monospace = [ fonts.monospace.name ];
|
||||
serif = [ fonts.serif.name ];
|
||||
sansSerif = [ fonts.sansSerif.name ];
|
||||
emoji = [ fonts.emoji.name ];
|
||||
};
|
||||
fonts.fontconfig.defaultFonts = lib.genAttrs [
|
||||
"monospace"
|
||||
"serif"
|
||||
"sansSerif"
|
||||
"emoji"
|
||||
] (family: lib.mkOrder listTargetIndex [ fonts.${family}.name ]);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ in
|
|||
../target.nix
|
||||
../release.nix
|
||||
../overlays.nix
|
||||
../ordering.nix
|
||||
] ++ autoload;
|
||||
config.warnings =
|
||||
lib.mkIf
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ in
|
|||
../pixel.nix
|
||||
../target.nix
|
||||
../overlays.nix
|
||||
../ordering.nix
|
||||
] ++ autoload;
|
||||
|
||||
# See https://github.com/nix-community/nix-on-droid/issues/436
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ in
|
|||
../target.nix
|
||||
../release.nix
|
||||
../overlays.nix
|
||||
../ordering.nix
|
||||
] ++ autoload;
|
||||
config.warnings =
|
||||
lib.mkIf
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ in
|
|||
../target.nix
|
||||
../release.nix
|
||||
../overlays.nix
|
||||
../ordering.nix
|
||||
] ++ autoload;
|
||||
config.warnings =
|
||||
lib.mkIf
|
||||
|
|
|
|||
13
stylix/ordering.nix
Normal file
13
stylix/ordering.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
options.stylix.listTargetIndex = lib.mkOption {
|
||||
description = ''
|
||||
The target index at which stylix inserts into lists.
|
||||
Intended for use as argument to `lib.mkOrder`.
|
||||
'';
|
||||
type = lib.types.int;
|
||||
default = 600;
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue