{ description = "Fake Flake"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; in { packages = rec { default = cfile; cfile = pkgs.stdenv.mkDerivation { name = "hello"; src = self; buildInputs = [ pkgs.gcc ]; buildPhase = "gcc -o hello ./hello.c"; installPhase = "mkdir -p $out/bin; install -t $out/bin hello"; }; pdf = let outputFilename = "yolo.pdf"; in pkgs.stdenv.mkDerivation { name = "some-pdf"; src = self; buildInputs = [ pkgs.typst cfile ]; buildPhase = '' ${cfile}/bin/hello > dummyfile.typ typst compile dummyfile.typ ${outputFilename} ''; installPhase = "mkdir $out; install -t $out ${outputFilename}"; }; }; }); }