flake-fonts/flake.nix

34 lines
1.1 KiB
Nix

# vim: set et sw=2 ts=2 sts=2:
{
description = "fonts";
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05-small;
outputs = { self, nixpkgs }:
let
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: (nixpkgs.lib.genAttrs allSystems (system: f {
pkgs = import nixpkgs { inherit system; };
}));
in rec {
#lib = {
# fetchfont = fetchfont;
#};
packages = forAllSystems ({pkgs}:
with pkgs;
let
fetchfont = callPackage ./fetchfont.nix { pkgs = pkgs // { inherit sfnt2woff-zopfli; }; };
sfnt2woff-zopfli = callPackage ./sfnt2woff-zopfli.nix {};
fonts = callPackage ./fonts.nix { fetchfont = fetchfont; };
default = callPackage ./collection.nix { fonts = fonts; };
in
fonts // { inherit sfnt2woff-zopfli default; }
);
devShell = forAllSystems ({pkgs}:
pkgs.mkShell {
name = "fonts-dev";
nativeBuildInputs = [ packages.${pkgs.system}.sfnt2woff-zopfli pkgs.woff2 ];
}
);
};
}