typstcard/flake.nix

56 lines
1.4 KiB
Nix
Raw Normal View History

2023-09-24 00:28:46 +00:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
utils,
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
in
utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {inherit system;};
in rec {
formatter = pkgs.alejandra;
packages.included-fonts = pkgs.runCommand "included-fonts" {} ''
mkdir -p $out/share/fonts/{truetype,opentype}
cp ${./fonts}/*.ttf $out/share/fonts/truetype
cp ${./fonts}/*.otf $out/share/fonts/opentype
'';
devShell = with pkgs;
mkShell {
packages = [
2023-12-03 01:16:39 +00:00
libreoffice
2023-09-24 00:28:46 +00:00
typst
python3
2023-09-24 05:06:59 +00:00
python3Packages.black
2023-09-24 00:28:46 +00:00
python3Packages.requests
2024-01-18 19:04:45 +00:00
python3Packages.types-requests
2023-09-24 00:28:46 +00:00
];
# We need CLDR main, not just the annotations
CLDR_ROOT = pkgs.cldr-annotations.overrideAttrs (final: prev: {
installPhase = ''
runHook preInstall
mkdir -p $out/share/unicode/cldr
mv common $out/share/unicode/cldr
runHook postInstall
'';
});
TYPST_FONT_PATHS = with pkgs; symlinkJoin {
name = "typst-fonts";
paths = [
packages.included-fonts
noto-fonts-emoji
];
};
};
});
}