Move monospace fonts into a theme

This commit is contained in:
Oliver Davies 2024-03-17 00:27:24 +00:00
parent 384da2a640
commit 5e5e46922c
4 changed files with 43 additions and 17 deletions

View file

@ -1,6 +1,7 @@
{ {
inputs, inputs,
desktop ? false, desktop ? false,
self,
}: {pkgs, ...}: let }: {pkgs, ...}: let
configure-gtk = pkgs.writeTextFile { configure-gtk = pkgs.writeTextFile {
name = "configure-gtk"; name = "configure-gtk";
@ -16,6 +17,8 @@
''; '';
}; };
theme = import "${self}/lib/theme" {inherit pkgs;};
username = "opdavies"; username = "opdavies";
in { in {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -185,7 +188,8 @@ in {
}; };
}; };
packages = with pkgs; [ packages = with pkgs;
[
(nerdfonts.override { (nerdfonts.override {
fonts = [ fonts = [
"AnonymousPro" "AnonymousPro"
@ -194,9 +198,11 @@ in {
"IntelOneMono" "IntelOneMono"
"Iosevka" "Iosevka"
"JetBrainsMono" "JetBrainsMono"
"Meslo"
]; ];
}) })
]
++ [
theme.fonts.monospace.package
]; ];
}; };

View file

@ -5,7 +5,7 @@
}: { }: {
desktop ? false, desktop ? false,
}: let }: let
configuration = import ./configuration.nix {inherit desktop inputs;}; configuration = import ./configuration.nix {inherit desktop inputs self;};
hardwareConfiguration = import ./hardware-configuration.nix; hardwareConfiguration = import ./hardware-configuration.nix;
in in
inputs.nixpkgs.lib.nixosSystem { inputs.nixpkgs.lib.nixosSystem {

View file

@ -1,4 +1,14 @@
{ {
lib,
pkgs,
self,
...
}: let
inherit (lib) strings;
inherit (strings) toInt;
theme = import "${self}/lib/theme" {inherit pkgs;};
in {
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;
@ -11,11 +21,10 @@
}; };
font = { font = {
size = 12.0; size = toInt "${theme.fonts.monospace.size}";
bold.style = "Regular"; bold.style = "Regular";
normal.family = "GeistMono Nerd Font Mono"; normal.family = "${theme.fonts.monospace.name}";
# fc-list : family | sort | grep "Nerd Font"
offset.y = 12; offset.y = 12;
glyph_offset.y = 6; glyph_offset.y = 6;

11
lib/theme/default.nix Normal file
View file

@ -0,0 +1,11 @@
{pkgs, ...}: {
fonts = {
monospace = {
name = "MesloLGSDZ Nerd Font Mono";
# fc-list : family | sort | grep "Nerd Font"
package = pkgs.nerdfonts.override {fonts = ["Meslo"];};
size = "10";
};
};
}