{ inputs = { typst.url = "github:typst/typst"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, typst, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; overlays = [ typst.overlays.default ]; }; fonts_path = with pkgs; lib.concatStringsSep ":" [ lato font-awesome raleway ]; in { devShell = pkgs.mkShell { packages = with pkgs; [ typst-dev typstfmt typst-lsp typst-live typst-preview ]; TYPST_FONT_PATHS = fonts_path; }; packages.default = pkgs.stdenvNoCC.mkDerivation { name = "resume"; dontUnpack = true; buildInputs = with pkgs; [ typst-dev ]; TYPST_FONT_PATHS = fonts_path; src = ./.; fontawesome = pkgs.fetchFromGitHub { owner = "duskmoon314"; repo = "typst-fontawesome"; rev = "1a0fcdca90ee07f297294c9c56fbcf3114340a47"; hash = "sha256-h9LZum2f9+rZ4l4hjcmE49gDLVlbJUkRi1xSbJLVAGg="; }; buildPhase = '' # copy sources cp -r $src/src . chmod -R +w src # replace fontawesome remote import with local import cp $fontawesome/lib.typ src/fontawesome.typ sed -i 's/#import "@preview\/fontawesome:0\.1\.0": \*/#import "fontawesome.typ": */g' src/resume.typ # compile typst to pdf typst compile src/resume.typ resume.pdf ''; installPhase = '' mkdir -p $out cp resume.pdf $out/resume.pdf ''; }; }); }