-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuzz.nix
More file actions
54 lines (45 loc) · 1.1 KB
/
fuzz.nix
File metadata and controls
54 lines (45 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ pkgs }:
let
name = "fuzz";
version = "0.0.1";
description = "Run fuzzing tests for Go projects";
in
pkgs.stdenvNoCC.mkDerivation {
pname = name;
inherit version;
src = ./.;
dontBuild = true;
doCheck = false;
nativeBuildInputs = with pkgs; [
makeWrapper
];
buildInputs = with pkgs; [
go
python3
];
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/fuzz/config
# Copy the Python script
cp scripts/${name}.py $out/bin/${name}
chmod +x $out/bin/${name}
# Copy shared configuration files
if [ -d shared ]; then
find shared -maxdepth 1 -type f -exec cp {} $out/share/fuzz/config/ \;
fi
# Wrap the script to ensure all dependencies are in PATH and set config path
wrapProgram $out/bin/${name} \
--prefix PATH : ${pkgs.lib.makeBinPath [
pkgs.go
pkgs.python3
]} \
--set FUZZ_CONFIG_DIR "$out/share/fuzz/config"
runHook postInstall
'';
meta = with pkgs.lib; {
inherit description;
platforms = platforms.unix;
maintainers = [ ];
license = licenses.mit;
};
}