nix: added commercial fonts

This commit is contained in:
biscuit
2025-05-21 09:01:53 -05:00
parent 6dbe009076
commit e862ce8f9b
2 changed files with 56 additions and 46 deletions
+25 -17
View File
@@ -1,21 +1,17 @@
{ {
description = "A flake giving access to fonts that I use, outside of nixpkgs."; description =
"A flake giving access to fonts that I use, outside of nixpkgs.";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { outputs = { self, nixpkgs, flake-utils }:
self, flake-utils.lib.eachDefaultSystem (system:
nixpkgs, let pkgs = nixpkgs.legacyPackages.${system};
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in { in {
defaultPackage = pkgs.symlinkJoin { defaultPackage = pkgs.symlinkJoin {
name = "myfonts-0.1.4"; name = "myfonts-0.1.4";
paths = paths = builtins.attrValues
builtins.attrValues
self.packages.${system}; # Add font derivation names here self.packages.${system}; # Add font derivation names here
}; };
@@ -23,23 +19,24 @@
name = "gillsans-font"; name = "gillsans-font";
dontConfigue = true; dontConfigue = true;
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://freefontsvault.s3.amazonaws.com/2020/02/Gill-Sans-Font-Family.zip"; url =
"https://freefontsvault.s3.amazonaws.com/2020/02/Gill-Sans-Font-Family.zip";
sha256 = "sha256-YcZUKzRskiqmEqVcbK/XL6ypsNMbY49qJYFG3yZVF78="; sha256 = "sha256-YcZUKzRskiqmEqVcbK/XL6ypsNMbY49qJYFG3yZVF78=";
stripRoot = false; stripRoot = false;
}; };
installPhase = '' installPhase = ''
runHook preInstall mkdir -p $out/share/fonts
install -Dm644 $src/*.ttf -t $out/share/fonts/opentype cp -R $src $out/share/fonts/opentype/
runHook postInstall
''; '';
meta = {description = "A Gill Sans Font Family derivation.";}; meta = { description = "A Gill Sans Font Family derivation."; };
}; };
packages.palatino = pkgs.stdenvNoCC.mkDerivation { packages.palatino = pkgs.stdenvNoCC.mkDerivation {
name = "palatino-font"; name = "palatino-font";
dontConfigue = true; dontConfigue = true;
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://www.dfonts.org/wp-content/uploads/fonts/Palatino.zip"; url =
"https://www.dfonts.org/wp-content/uploads/fonts/Palatino.zip";
sha256 = "sha256-FBA8Lj2yJzrBQnazylwUwsFGbCBp1MJ1mdgifaYches="; sha256 = "sha256-FBA8Lj2yJzrBQnazylwUwsFGbCBp1MJ1mdgifaYches=";
stripRoot = false; stripRoot = false;
}; };
@@ -47,7 +44,18 @@
mkdir -p $out/share/fonts mkdir -p $out/share/fonts
cp -R $src/Palatino $out/share/fonts/truetype/ cp -R $src/Palatino $out/share/fonts/truetype/
''; '';
meta = {description = "The Palatino Font Family derivation.";}; meta = { description = "The Palatino Font Family derivation."; };
};
packages.monolisa = pkgs.stdenvNoCC.mkDerivation {
name = "monolisa-font";
dontConfigue = true;
src = ./.;
installPhase = ''
mkdir -p $out/share/fonts
cp -R $src/fonts/Monolisa $out/share/fonts/truetype
'';
meta = { description = "The Monolisa Font Family derivation."; };
}; };
}); });
} }
+3 -1
View File
@@ -4,9 +4,11 @@
system, system,
... ...
}: let }: let
unlisted-fonts = inputs.unlisted-fonts.packages.${pkgs.system};
in { in {
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
monolisa unlisted-fonts.gillsans
unlisted-fonts.monolisa
nerd-fonts.fira-code nerd-fonts.fira-code
nerd-fonts.jetbrains-mono nerd-fonts.jetbrains-mono
nerd-fonts.iosevka nerd-fonts.iosevka