2024-01-29 16:49:41 -06:00
|
|
|
{
|
2024-02-02 00:18:04 -06:00
|
|
|
description = "A script to patch the MonoLisa font with Nerd Fonts glyphs.";
|
2024-02-02 00:31:43 -06:00
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
alejandra.url = "github:kamadorueda/alejandra";
|
|
|
|
};
|
2024-01-29 16:49:41 -06:00
|
|
|
|
|
|
|
outputs = inputs @ {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2024-02-02 00:31:43 -06:00
|
|
|
alejandra,
|
2024-01-29 16:49:41 -06:00
|
|
|
}: let
|
|
|
|
inherit (nixpkgs.lib) genAttrs;
|
|
|
|
forAllSystems = f:
|
2024-02-02 00:32:16 -06:00
|
|
|
genAttrs [
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-linux"
|
|
|
|
"aarch64-darwin"
|
|
|
|
] (system: f nixpkgs.legacyPackages.${system});
|
2024-01-29 16:49:41 -06:00
|
|
|
in {
|
2024-02-02 00:32:16 -06:00
|
|
|
packages = forAllSystems (pkgs:
|
2024-01-30 20:33:49 -06:00
|
|
|
with pkgs; {
|
|
|
|
default = stdenv.mkDerivation {
|
2024-02-02 00:32:16 -06:00
|
|
|
name = "monolisa-nerdfont-patch";
|
|
|
|
src = ./.;
|
|
|
|
nativeBuildInputs = [makeWrapper];
|
|
|
|
buildInputs = [fontforge python3];
|
|
|
|
unpackPhase = ":";
|
|
|
|
buildPhase = ":";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -m755 -D ${./patch-monolisa} $out/bin/monolisa-nerdfont-patch
|
|
|
|
install -m755 -D ${./font-patcher} $out/bin/font-patcher
|
|
|
|
cp -r ${./bin} $out/bin/bin
|
|
|
|
cp -r ${./src} $out/bin/src
|
2024-01-30 20:33:49 -06:00
|
|
|
'';
|
2024-02-02 00:32:16 -06:00
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/monolisa-nerdfont-patch \
|
|
|
|
--set PATH ${lib.makeBinPath [fontforge]}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
});
|
2024-01-30 20:33:49 -06:00
|
|
|
|
2024-02-02 00:32:16 -06:00
|
|
|
devShells = forAllSystems (pkgs:
|
|
|
|
with pkgs; {
|
|
|
|
default = mkShell {buildInputs = [fontforge python3 pre-commit];};
|
|
|
|
});
|
2024-02-02 00:31:43 -06:00
|
|
|
|
|
|
|
formatter.x86_64-linux = alejandra.packages.x86_64-linux.default;
|
2024-01-29 16:49:41 -06:00
|
|
|
};
|
|
|
|
}
|