{font-packages,fontconfig}: init (#1381)
Link: https://github.com/nix-community/stylix/pull/1381 Reviewed-by: Flameopathic <64027365+Flameopathic@users.noreply.github.com> Reviewed-by: awwpotato <awwpotato@voidq.com> Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk> Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
commit
7e9cced782
13 changed files with 96 additions and 38 deletions
13
modules/font-packages/darwin.nix
Normal file
13
modules/font-packages/darwin.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ mkTarget, ... }:
|
||||
mkTarget {
|
||||
name = "font-packages";
|
||||
humanName = "Font packages";
|
||||
|
||||
configElements =
|
||||
{ fonts }:
|
||||
{
|
||||
fonts = {
|
||||
inherit (fonts) packages;
|
||||
};
|
||||
};
|
||||
}
|
||||
13
modules/font-packages/hm.nix
Normal file
13
modules/font-packages/hm.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ mkTarget, ... }:
|
||||
mkTarget {
|
||||
name = "font-packages";
|
||||
humanName = "Font packages";
|
||||
|
||||
configElements =
|
||||
{ fonts }:
|
||||
{
|
||||
home = {
|
||||
inherit (fonts) packages;
|
||||
};
|
||||
};
|
||||
}
|
||||
15
modules/font-packages/meta.nix
Normal file
15
modules/font-packages/meta.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
name = "Font packages";
|
||||
maintainers = [ lib.maintainers.mightyiam ];
|
||||
description = ''
|
||||
This module makes the Stylix fonts available in the environment of each of
|
||||
the platforms that this module supports.
|
||||
|
||||
### Related modules
|
||||
|
||||
<!-- If updating this section, make sure to update it on the linked pages too. -->
|
||||
|
||||
- [Fontconfig](fontconfig.md)
|
||||
'';
|
||||
}
|
||||
13
modules/font-packages/nixos.nix
Normal file
13
modules/font-packages/nixos.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ mkTarget, ... }:
|
||||
mkTarget {
|
||||
name = "font-packages";
|
||||
humanName = "Font packages";
|
||||
|
||||
configElements =
|
||||
{ fonts }:
|
||||
{
|
||||
fonts = {
|
||||
inherit (fonts) packages;
|
||||
};
|
||||
};
|
||||
}
|
||||
9
modules/fontconfig/hm.nix
Normal file
9
modules/fontconfig/hm.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ mkTarget, ... }:
|
||||
mkTarget {
|
||||
name = "fontconfig";
|
||||
humanName = "Fontconfig";
|
||||
|
||||
configElements = {
|
||||
fonts.fontconfig.enable = true;
|
||||
};
|
||||
}
|
||||
17
modules/fontconfig/meta.nix
Normal file
17
modules/fontconfig/meta.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
name = "Fontconfig";
|
||||
homepage = "https://fontconfig.org";
|
||||
maintainers = [ lib.maintainers.mightyiam ];
|
||||
description = ''
|
||||
On NixOS, `fonts.fontconfig.defaultFonts` options are declared without
|
||||
enabling `fonts.fontconfig.enable`. On Home Manager, only the
|
||||
`fonts.fontconfig.enable` option is declared and enabled.
|
||||
|
||||
### Related modules
|
||||
|
||||
<!-- If updating this section, make sure to update it on the linked pages too. -->
|
||||
|
||||
- [Font packages](font-packages.md)
|
||||
'';
|
||||
}
|
||||
16
modules/fontconfig/nixos.nix
Normal file
16
modules/fontconfig/nixos.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ mkTarget, ... }:
|
||||
mkTarget {
|
||||
name = "fontconfig";
|
||||
humanName = "Fontconfig";
|
||||
|
||||
configElements =
|
||||
{ fonts }:
|
||||
{
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
monospace = [ fonts.monospace.name ];
|
||||
serif = [ fonts.serif.name ];
|
||||
sansSerif = [ fonts.sansSerif.name ];
|
||||
emoji = [ fonts.emoji.name ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -9,7 +9,6 @@ let
|
|||
in
|
||||
{
|
||||
imports = [
|
||||
./fonts.nix
|
||||
./palette.nix
|
||||
../fonts.nix
|
||||
../home-manager-integration.nix
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config.fonts = lib.mkIf config.stylix.enable {
|
||||
inherit (config.stylix.fonts) packages;
|
||||
};
|
||||
}
|
||||
|
|
@ -10,7 +10,6 @@ in
|
|||
{
|
||||
imports = [
|
||||
./cursor.nix
|
||||
./fonts.nix
|
||||
./icon.nix
|
||||
./palette.nix
|
||||
../cursor.nix
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.stylix.fonts;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.stylix.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = cfg.packages;
|
||||
};
|
||||
}
|
||||
|
|
@ -10,7 +10,6 @@ in
|
|||
{
|
||||
imports = [
|
||||
./cursor.nix
|
||||
./fonts.nix
|
||||
./palette.nix
|
||||
../cursor.nix
|
||||
../fonts.nix
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.stylix.fonts;
|
||||
in
|
||||
{
|
||||
config.fonts = lib.mkIf config.stylix.enable {
|
||||
inherit (cfg) packages;
|
||||
|
||||
fontconfig.defaultFonts = {
|
||||
monospace = [ cfg.monospace.name ];
|
||||
serif = [ cfg.serif.name ];
|
||||
sansSerif = [ cfg.sansSerif.name ];
|
||||
emoji = [ cfg.emoji.name ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue