From e6ed60548397627bf10f561f9438201dbba0a36e Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 21 Apr 2024 02:15:42 +0300 Subject: 2024-04-21 --- modules/common/stylix.nix | 105 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 modules/common/stylix.nix (limited to 'modules/common/stylix.nix') diff --git a/modules/common/stylix.nix b/modules/common/stylix.nix new file mode 100644 index 0000000..953685e --- /dev/null +++ b/modules/common/stylix.nix @@ -0,0 +1,105 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: +with lib; +{ + imports = [ + inputs.stylix.nixosModules.stylix + (mkAliasOptionModule [ "colors" ] [ + "lib" + "stylix" + "colors" + ]) + ]; + + options.nixfiles.modules.common.stylix.fonts.extraPackages = mkOption { + description = "Font packages."; + default = with pkgs; [ + font-awesome + noto-fonts + noto-fonts-emoji + sarasa-gothic + source-han-mono + source-han-sans + source-han-serif + twitter-color-emoji + ]; + readOnly = true; + }; + + # Styling and color binding can be sourced from here[1]. + # + # [1]: https://github.com/tinted-theming/base24/blob/master/styling.md + config = { + stylix = { + image = pkgs.fetchurl { + url = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Bonaparte_ante_la_Esfinge%2C_por_Jean-Léon_Gérôme.jpg"; + sha256 = "sha256-qWv52oT8cF9K4ZoeawmR3jgoGB2ARfjbKKc12IljUcM="; + }; + + base16Scheme = "${pkgs.base16-schemes}/share/themes/tomorrow.yaml"; + + fonts = { + monospace = { + package = pkgs.iosevka; + name = "Iosevka"; + }; + + serif = { + package = pkgs.iosevka-bin.override { variant = "Etoile"; }; + name = "Iosevka Etoile"; + }; + + sansSerif = { + package = pkgs.iosevka-bin.override { variant = "Aile"; }; + name = "Iosevka Aile"; + }; + + sizes = { + desktop = 10; + applications = 10; + terminal = 12; + }; + }; + + cursor = { + name = "phinger-cursors-light"; + package = pkgs.phinger-cursors; + size = 32; + }; + }; + + fonts = { + packages = mkAfter config.nixfiles.modules.common.stylix.fonts.extraPackages; + + fontconfig.defaultFonts = with config.stylix.fonts; { + serif = mkForce [ + serif.name + "Sarasa Gothic" + "Source Han Serif" + "Noto Serif" + ]; + sansSerif = mkForce [ + sansSerif.name + "Sarasa Gothic" + "Source Han Sans" + "Noto Sans" + ]; + monospace = mkForce [ + monospace.name + "Sarasa Mono" + "Source Han Mono" + "Noto Sans Mono" + ]; + emoji = mkForce [ + "Twitter Color Emoji" + "Noto Color Emoji" + ]; + }; + }; + }; +} -- cgit v1.2.3