function to lib, packages for any system

master
Denis Knauf 2023-06-17 00:32:57 +02:00
parent 5963940d6b
commit 4b8974f7aa
1 changed files with 12 additions and 7 deletions

View File

@ -7,12 +7,17 @@
sfnt2woff-zopfli = callPackage ./sfnt2woff-zopfli.nix {};
fetchfont = callPackage ./fetchfont.nix {sfnt2woff-zopfli = sfnt2woff-zopfli; };
fonts = callPackage ./fonts.nix {fetchfont = fetchfont; };
in
fetchfont = fetchfont;
defaultPackage.x86_64-linux =
with import nixpkgs { system = "x86_64-linux"; };
fonts // { sfnt2woff-zopfli = sfnt2woff-zopfli; };
};
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 {
lib = {
fetchfont = fetchfont;
};
packages = forAllSystems {pkgs}: {
default = fonts // { sfnt2woff-zopfli = sfnt2woff-zopfli; };
};
};
}