From 744af52f76c2160b7ccdd3ad38dc50f56916ea5f Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Thu, 12 Mar 2026 09:27:07 +0100 Subject: [PATCH] slightly restructure flake --- flake.nix | 83 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/flake.nix b/flake.nix index c54b897..066bd7b 100644 --- a/flake.nix +++ b/flake.nix @@ -328,39 +328,57 @@ rec { # - Setup hooks, for example makeWrapper/autoPatchelfHook # - Interpreters needed by patchShebangs for build scripts (with the --build flag), which can be the case for e.g. perl nativeBuildInputs = with pkgs; [ - autoPatchelfHook + just + xxd + wabt + grub2 + xorriso + mariadb.client + iwasm + wamrc + fail-bin + + # Don't install to not pollute our PATH. Just export as environment variable. + # wasi-sdk + # libiwasm_debug + # libiwasm_release ]; # Add dependencies to buildInputs if they will end up copied or linked into the final output or otherwise used at runtime: # - Libraries used by compilers, for example zlib # - Interpreters needed by patchShebangs for scripts which are installed, which can be the case for e.g. perl - buildInputs = with pkgs; [ - # FAIL runtime dependencies - python # bochs-experiment-runner.py, resultbrowser.py - alsa-lib # libasound.so.2 - boost_pkgs.boost174 # libboost_coroutine.so.1.74.0, libboost_regex.so.1.74.0, libboost_thread.so.1.74.0 - capstone_4 # libcapstone.so.4 - libdwarf_pkgs.libdwarf # libdwarf.so.1 - elfutils # libelf.so.1 - mariadb # libmariadb.so.3 - libpcl # libpcl.so.1 - protobuf_21 # libprotobuf.so.32 - SDL # libSDL-1.2.so.0 - libx11 # libX11.so.6 - libxrandr # libXrandr.so.2 - libz # libz.so.1 - ]; + buildInputs = with pkgs; []; # =========================================================================================== # Define buildable + installable packages # =========================================================================================== fail-bin = stdenv.mkDerivation { - inherit nativeBuildInputs buildInputs; pname = "fail"; version = "1.0.0"; src = ./.; + nativeBuildInputs = with pkgs; [ + autoPatchelfHook + ]; + + buildInputs = with pkgs; [ + # FAIL runtime dependencies + python # bochs-experiment-runner.py, resultbrowser.py + alsa-lib # libasound.so.2 + boost_pkgs.boost174 # libboost_coroutine.so.1.74.0, libboost_regex.so.1.74.0, libboost_thread.so.1.74.0 + capstone_4 # libcapstone.so.4 + libdwarf_pkgs.libdwarf # libdwarf.so.1 + elfutils # libelf.so.1 + mariadb # libmariadb.so.3 + libpcl # libpcl.so.1 + protobuf_21 # libprotobuf.so.32 + SDL # libSDL-1.2.so.0 + libx11 # libX11.so.6 + libxrandr # libXrandr.so.2 + libz # libz.so.1 + ]; + installPhase = '' runHook preInstall @@ -375,35 +393,28 @@ rec { # Provide package for "nix build" packages = { default = fail-bin; + fail = fail-bin; + wasi-sdk = wasi-sdk; + iwasm = iwasm; + wamrc = wamrc; + libiwasm = libiwasm_release; }; apps = { default = flake-utils.lib.mkApp {drv = fail-bin;}; + fail = fail-bin; + wasi-sdk = wasi-sdk; + iwasm = iwasm; + wamrc = wamrc; + libiwasm = libiwasm_release; }; devShells = { # Provide default environment for "nix develop". # Other environments can be added below. default = pkgs.mkShell { - inherit shellHook; + inherit nativeBuildInputs buildInputs shellHook; name = description; - nativeBuildInputs = with pkgs; [ - just - xxd - wabt - grub2 - xorriso - mariadb.client - iwasm - wamrc - fail-bin - - # Don't install to not pollute our PATH. Just export as environment variable. - # wasi-sdk - # libiwasm_debug - # libiwasm_release - ]; - # ========================================================================================= # Define environment variables # =========================================================================================