From 8014a91e54836223ce71d37cd4a882626fa152d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Tue, 14 Jun 2022 15:11:01 +0100 Subject: [PATCH] add nasin-nanpa --- flake.lock | 17 +++++++++++++++++ flake.nix | 3 +++ fonts/nasin-nanpa.nix | 28 ++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 fonts/nasin-nanpa.nix diff --git a/flake.lock b/flake.lock index 13b393f..5aaa299 100644 --- a/flake.lock +++ b/flake.lock @@ -130,6 +130,22 @@ "url": "https://git.chir.rs/CarolineHusky/MiiFox.net" } }, + "nasin-nanpa": { + "flake": false, + "locked": { + "lastModified": 1653261911, + "narHash": "sha256-f92PUd4pIS7wK5W0vJ79Qvtw1d8VVW0gquBWW1XWSpw=", + "owner": "ETBCOR", + "repo": "nasin-nanpa", + "rev": "4cf4a762576d8ca2818683139ab1d04d149c9bec", + "type": "github" + }, + "original": { + "owner": "ETBCOR", + "repo": "nasin-nanpa", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1653581809, @@ -187,6 +203,7 @@ "matrix-media-repo": "matrix-media-repo", "mautrix-whatsapp": "mautrix-whatsapp", "miifox-net": "miifox-net", + "nasin-nanpa": "nasin-nanpa", "nixpkgs": "nixpkgs_2", "nixpkgs-go116": "nixpkgs-go116" } diff --git a/flake.nix b/flake.nix index 5159cf0..7114b8f 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,8 @@ gomod2nix.url = "github:tweag/gomod2nix"; kreative-open-relay.url = "github:kreativekorp/open-relay"; kreative-open-relay.flake = false; + nasin-nanpa.url = "github:ETBCOR/nasin-nanpa"; + nasin-nanpa.flake = false; }; outputs = { @@ -49,6 +51,7 @@ ./matrix/matrix-media-repo ./matrix/mautrix-whatsapp ./fonts/kreative.nix + ./fonts/nasin-nanpa.nix ]); hydraJobs = { diff --git a/fonts/nasin-nanpa.nix b/fonts/nasin-nanpa.nix new file mode 100644 index 0000000..fbaeabb --- /dev/null +++ b/fonts/nasin-nanpa.nix @@ -0,0 +1,28 @@ +{ inputs, pkgs, ...}: rec { + nasin-nanpa = pkgs.stdenvNoCC.mkDerivation rec { + pname = "nasin-nanpa"; + version = "2.5.25"; + src = inputs.nasin-nanpa; + nativeBuildInputs = [pkgs.fontforge]; + buildPhase = '' + fontforge -lang=ff -c 'Open($1); Generate($2)' "ffversions/2.5/nasin-nanpa-${version}.sfd" "nasin-nanpa.otf" + ''; + installPhase = '' + install -m444 -Dt $out/share/fonts/opentype/nasin-nanpa nasin-nanpa.otf + ''; + }; + nasin-nanpa-woff2 = pkgs.stdenvNoCC.mkDerivation rec { + name = "nasin-nanpa-${nasin-nanpa.version}.woff2"; + inherit (nasin-nanpa) version; + src = inputs.nasin-nanpa; + buildInputs = [nasin-nanpa]; + nativeBuildInputs = [pkgs.woff2]; + buildPhase = '' + cp ${nasin-nanpa}/share/fonts/opentype/nasin-nanpa/nasin-nanpa.otf . + woff2_compress nasin-nanpa.otf + ''; + installPhase = '' + cp nasin-nanpa.woff2 $out + ''; + }; +}