monolisa-nerdfont-patch/flake.nix

62 lines
1.7 KiB
Nix
Raw Normal View History

2024-01-29 16:49:41 -06:00
{
description = "A script to patch the MonoLisa font with Nerd Fonts glyphs.";
2024-01-29 16:49:41 -06:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
};
outputs = {
2024-01-29 16:49:41 -06:00
self,
nixpkgs,
systems,
2024-01-29 16:49:41 -06:00
}: let
inherit (nixpkgs.lib) genAttrs makeBinPath;
eachSystem = fn:
2024-03-31 11:15:34 -05:00
genAttrs (import systems) (system:
fn system (import nixpkgs {
2024-02-12 10:11:29 -06:00
inherit system;
overlays = [self.overlays.default];
}));
2024-01-29 16:49:41 -06:00
in {
overlays = {
default = final: _prev: let
pkgs = final;
in {
monolisa-nerdfont-patch = pkgs.stdenv.mkDerivation {
name = "monolisa-nerdfont-patch";
src = ./.;
nativeBuildInputs = with pkgs; [makeWrapper];
buildInputs = with pkgs; [fontforge python3];
buildPhase = ":";
installPhase = ''
mkdir -p $out/bin
2024-03-31 11:15:34 -05:00
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
'';
postFixup = ''
wrapProgram $out/bin/monolisa-nerdfont-patch \
2024-03-31 11:15:34 -05:00
--set PATH ${makeBinPath (with pkgs; [fontforge])}
2024-01-30 20:33:49 -06:00
'';
};
2024-01-30 20:33:49 -06:00
};
};
2024-01-30 20:33:49 -06:00
packages = eachSystem (system: pkgs: {
default = self.packages.${system}.monolisa-nerdfont-patch;
monolisa-nerdfont-patch = pkgs.monolisa-nerdfont-patch;
});
devShells = eachSystem (_: pkgs: {
default = pkgs.mkShell {
2024-03-31 11:15:34 -05:00
packages = with pkgs; [fontforge python3 pre-commit];
};
});
2024-03-31 11:15:34 -05:00
formatter = eachSystem (_: pkgs: pkgs.nixfmt);
2024-01-29 16:49:41 -06:00
};
}