{ description = "HEX - a collection of terminal libraries"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; outputs = { self, nixpkgs }: let systems = [ "x86_64-linux" "aarch64-linux" ]; forAllSystems = nixpkgs.lib.genAttrs systems; package = pkgs: let inherit (pkgs) zig libssh pkg-config; in pkgs.stdenv.mkDerivation { pname = "hex"; version = "0.0.0"; src = self; meta.mainProgram = "demo"; nativeBuildInputs = [ zig pkg-config ]; buildInputs = [ libssh ]; dontConfigure = true; dontInstall = true; buildPhase = '' runHook preBuild export ZIG_GLOBAL_CACHE_DIR="$TMPDIR/zig-global" export ZIG_LOCAL_CACHE_DIR="$TMPDIR/zig-local" zig build --prefix "$out" demo runHook postBuild ''; }; in { packages = forAllSystems (system: { default = package nixpkgs.legacyPackages.${system}; }); devShells = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; in { default = pkgs.mkShell { packages = [ pkgs.zig pkgs.pkg-config pkgs.libssh ]; }; }); }; }