94 lines
2.6 KiB
Nix
94 lines
2.6 KiB
Nix
{
|
|
description = "A devShell example";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
overlays = [ (import rust-overlay) ];
|
|
pkgs = import nixpkgs {
|
|
inherit system overlays;
|
|
};
|
|
my-python-packages = ps: with ps; [
|
|
sphinx
|
|
sphinx_rtd_theme
|
|
# other python packages
|
|
];
|
|
in
|
|
with pkgs;
|
|
rec {
|
|
devShell = mkShell.override {stdenv = stdenv;} { # LibAFL needs LLVM
|
|
buildInputs = [
|
|
rust-bin.stable.latest.default
|
|
cargo-make
|
|
llvmPackages_19.clangUseLLVM
|
|
llvmPackages_19.libclang
|
|
llvmPackages_19.libllvm
|
|
zlib
|
|
cargo-flamegraph
|
|
# für qemu
|
|
(pkgs.python3.withPackages my-python-packages)
|
|
meson # unsure
|
|
ninja
|
|
pkg-config
|
|
glib
|
|
pixman
|
|
# libslirp
|
|
# für analyse der in-/outputs
|
|
xxd
|
|
# FreeRTOS
|
|
gcc-arm-embedded
|
|
openssl_legacy # gdb needs libcrypt.so.1
|
|
# generate bindings from RTOS to Rust
|
|
rust-bindgen
|
|
# compare libafl edges
|
|
packages.edge_compare
|
|
# Debugging
|
|
ddd
|
|
# visualization
|
|
graphviz
|
|
#rstudioWrapper # prefer host packages for R
|
|
#R
|
|
# dependencies for mosaic
|
|
freetype
|
|
fontconfig
|
|
# benchmarking
|
|
snakemake
|
|
vim
|
|
psmisc
|
|
sqlite
|
|
];
|
|
|
|
shellHook = ''
|
|
export CUSTOM_QEMU_DIR=$(pwd)/qemu-libafl-bridge
|
|
export LIBAFL_QEMU_DIR=$(pwd)/qemu-libafl-bridge
|
|
export CUSTOM_QEMU_NO_BUILD=1
|
|
export CUSTOM_QEMU_NO_CONFIGURE=1
|
|
export LIBAFL_EDGES_MAP_SIZE_IN_USE=1048576
|
|
# export EMULATION_MODE=systemmode
|
|
# export CPU_TARGET=arm
|
|
# export CROSS_CC=arm-none-eabi-gcc
|
|
export LIBCLANG_PATH=${llvmPackages_19.libclang.lib}/lib
|
|
export BENCHDIR=bench_default
|
|
'';
|
|
};
|
|
|
|
packages = {
|
|
edge_compare=rustPlatform.buildRustPackage rec {
|
|
pname = "edge_compare";
|
|
version = "0.1.0";
|
|
|
|
src = ./edge_compare;
|
|
|
|
cargoSha256 = "sha256-47THUU9aKhAwb2Tz8bJWDmVhDokpr+DOiFNZhmsN8Gk=";
|
|
};
|
|
};
|
|
}
|
|
);
|
|
}
|