From 9a12e1f7bb475fb42328c01c0250599e8cb0a625 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 19 Dec 2024 11:09:15 -0500 Subject: [PATCH] add `customfonts` custom package --- nixos/gui-pkgs.nix | 2 ++ packages/customfonts.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 packages/customfonts.nix diff --git a/nixos/gui-pkgs.nix b/nixos/gui-pkgs.nix index 07dad31..125c3c4 100644 --- a/nixos/gui-pkgs.nix +++ b/nixos/gui-pkgs.nix @@ -21,6 +21,7 @@ let libnotify hoppscotch ]; + customfonts = pkgs.callPackage ../packages/customfonts.nix { inherit pkgs; }; in { environment.systemPackages = lib.lists.unique (kdePackages ++ packages); @@ -44,6 +45,7 @@ in programs.partition-manager.enable = true; fonts.packages = with pkgs; [ + customfonts corefonts nerd-fonts.fira-code ]; diff --git a/packages/customfonts.nix b/packages/customfonts.nix new file mode 100644 index 0000000..47424eb --- /dev/null +++ b/packages/customfonts.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: + +pkgs.stdenv.mkDerivation { + pname = "customfonts"; + version = "1.0"; + + src = pkgs.fetchurl { + url = "https://www.coastalcommits.com/cswimr/fonts/archive/master.tar.gz"; + sha256 = "sha256-XBRNu1DxjhfloJkQrFy4Wz4IUD6abhKcZKkX/snyxs4"; + }; + + unpackPhase = '' + runHook preUnpack + ${pkgs.gnutar}/bin/tar xf $src + + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + install -Dm644 fonts/ttf/ComicCode/*.ttf -t $out/share/fonts/truetype + install -Dm644 fonts/otf/ComicCode/*.otf -t $out/share/fonts/opentype + + install -Dm644 fonts/ttf/ComicCodeNerdFont/*.ttf -t $out/share/fonts/truetype + install -Dm644 fonts/otf/ComicCodeNerdFont/*.otf -t $out/share/fonts/opentype + + runHook postInstall + ''; +}