slightly restructure flake

This commit is contained in:
2026-03-12 09:27:07 +01:00
parent 43414edd0a
commit 744af52f76

View File

@ -328,12 +328,40 @@ rec {
# - Setup hooks, for example makeWrapper/autoPatchelfHook # - 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 # - Interpreters needed by patchShebangs for build scripts (with the --build flag), which can be the case for e.g. perl
nativeBuildInputs = with pkgs; [ 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: # 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 # - 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 # - Interpreters needed by patchShebangs for scripts which are installed, which can be the case for e.g. perl
buildInputs = with pkgs; [];
# ===========================================================================================
# Define buildable + installable packages
# ===========================================================================================
fail-bin = stdenv.mkDerivation {
pname = "fail";
version = "1.0.0";
src = ./.;
nativeBuildInputs = with pkgs; [
autoPatchelfHook
];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
# FAIL runtime dependencies # FAIL runtime dependencies
python # bochs-experiment-runner.py, resultbrowser.py python # bochs-experiment-runner.py, resultbrowser.py
@ -351,16 +379,6 @@ rec {
libz # libz.so.1 libz # libz.so.1
]; ];
# ===========================================================================================
# Define buildable + installable packages
# ===========================================================================================
fail-bin = stdenv.mkDerivation {
inherit nativeBuildInputs buildInputs;
pname = "fail";
version = "1.0.0";
src = ./.;
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
@ -375,35 +393,28 @@ rec {
# Provide package for "nix build" # Provide package for "nix build"
packages = { packages = {
default = fail-bin; default = fail-bin;
fail = fail-bin;
wasi-sdk = wasi-sdk;
iwasm = iwasm;
wamrc = wamrc;
libiwasm = libiwasm_release;
}; };
apps = { apps = {
default = flake-utils.lib.mkApp {drv = fail-bin;}; default = flake-utils.lib.mkApp {drv = fail-bin;};
fail = fail-bin;
wasi-sdk = wasi-sdk;
iwasm = iwasm;
wamrc = wamrc;
libiwasm = libiwasm_release;
}; };
devShells = { devShells = {
# Provide default environment for "nix develop". # Provide default environment for "nix develop".
# Other environments can be added below. # Other environments can be added below.
default = pkgs.mkShell { default = pkgs.mkShell {
inherit shellHook; inherit nativeBuildInputs buildInputs shellHook;
name = description; 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 # Define environment variables
# ========================================================================================= # =========================================================================================