monolisa-nerdfont-patch/flake.nix

54 lines
1.5 KiB
Nix
Raw Normal View History

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";
2024-02-02 00:34:31 -06:00
systems.url = "github:nix-systems/default";
2024-02-02 00:31:43 -06:00
alejandra.url = "github:kamadorueda/alejandra";
};
2024-01-29 16:49:41 -06:00
2024-02-02 00:34:31 -06:00
outputs = {
2024-01-29 16:49:41 -06:00
self,
nixpkgs,
2024-02-02 00:34:31 -06:00
systems,
2024-02-02 00:31:43 -06:00
alejandra,
2024-01-29 16:49:41 -06:00
}: let
2024-02-02 00:44:50 -06:00
inherit (nixpkgs) lib;
eachSystem = fn:
2024-02-02 00:44:50 -06:00
lib.genAttrs (import systems) (system: let
pkgs = import nixpkgs {localSystem.system = system;};
in
fn system pkgs);
2024-01-29 16:49:41 -06:00
in {
packages = eachSystem (_: pkgs: {
default = pkgs.stdenv.mkDerivation {
name = "monolisa-nerdfont-patch";
src = ./.;
nativeBuildInputs = with pkgs; [makeWrapper];
buildInputs = with pkgs; [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
'';
postFixup = ''
wrapProgram $out/bin/monolisa-nerdfont-patch \
--set PATH ${lib.makeBinPath (with pkgs; [fontforge])}
'';
};
});
2024-01-30 20:33:49 -06:00
devShells = eachSystem (_: pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [fontforge python3 pre-commit];
};
});
2024-02-02 00:31:43 -06:00
formatter = eachSystem (system: _: alejandra.packages.${system}.default);
2024-01-29 16:49:41 -06:00
};
}