From 306e540a6775c72df4c69e00b5e4d0e6c8c5cad4 Mon Sep 17 00:00:00 2001 From: biscuit Date: Wed, 21 May 2025 00:07:43 -0500 Subject: [PATCH] upd --- custom/unlisted-fonts/flake.lock | 4 +-- custom/unlisted-fonts/flake.nix | 61 +++++++++++++++++++------------- custom/unlisted-fonts/result | 2 +- system/font.nix | 2 +- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/custom/unlisted-fonts/flake.lock b/custom/unlisted-fonts/flake.lock index 3a4baec..1c513ae 100644 --- a/custom/unlisted-fonts/flake.lock +++ b/custom/unlisted-fonts/flake.lock @@ -22,13 +22,13 @@ "locked": { "lastModified": 1747744144, "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" diff --git a/custom/unlisted-fonts/flake.nix b/custom/unlisted-fonts/flake.nix index 66ccb44..22e0484 100644 --- a/custom/unlisted-fonts/flake.nix +++ b/custom/unlisted-fonts/flake.nix @@ -1,27 +1,40 @@ -{ stdenvNoCC, lib }: +{ + description = "A flake that gives access to the Monolisa font."; -stdenvNoCC.mkDerivation { - pname = "monolisa-font"; - version = "1.0.0"; - - src = ./Monolisa; - - dontUnpack = true; - buildPhase = "true"; - - installPhase = '' - runHook preInstall - - install -dm755 $out/share/fonts/truetype - cp -v $src/*.ttf $out/share/fonts/truetype/ - - runHook postInstall - ''; - - meta = with lib; { - description = "Monolisa font"; - homepage = "https://www.monolisa.dev/"; - license = licenses.unfreeRedistributable; # because Monolisa is not FOSS - platforms = platforms.all; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; }; + + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.monolisa-font = pkgs.stdenvNoCC.mkDerivation { + pname = "monolisa-font"; + version = "0.1"; + + # Use a relative path to the actual font folder + src = ./fonts/Monolisa; + + dontUnpack = true; + buildPhase = "true"; # no-op + + installPhase = '' + mkdir -p $out/share/fonts/truetype + install -m444 -Dt $out/share/fonts/truetype $src/*.ttf + ''; + + meta = { + description = "Monolisa font package"; + # license = pkgs.lib.licenses.unfree; # change if needed + }; + }; + + defaultPackage = self.packages.${system}.monolisa-font; + }); } diff --git a/custom/unlisted-fonts/result b/custom/unlisted-fonts/result index 1b57748..cff1536 120000 --- a/custom/unlisted-fonts/result +++ b/custom/unlisted-fonts/result @@ -1 +1 @@ -/nix/store/d5772qva7s7c253axhjjd4qssp08gfsz-monolisa-font-0.1 \ No newline at end of file +/nix/store/k6957fa1cpy0cdy0jjxfcs5bv7pr8fwk-monolisa-font-0.1 \ No newline at end of file diff --git a/system/font.nix b/system/font.nix index 51586b5..36e114d 100644 --- a/system/font.nix +++ b/system/font.nix @@ -5,7 +5,7 @@ ... }: { environment.systemPackages = with pkgs; [ - inputs.monolisa.packages.${system}.monolisa + inputs.monolisa.packages.${system}.monolisa-font ]; fonts.packages = with pkgs; [ nerd-fonts.fira-code