-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
128 lines (120 loc) · 3.74 KB
/
flake.nix
File metadata and controls
128 lines (120 loc) · 3.74 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{
description = "Suvi: Crash consistency testing for PM and NVMe File Systems";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
globset = {
url = "github:pdtpartners/globset";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
panda = {
url = "github:lluchs/panda/flake";
inputs.nixpkgs.follows = "nixpkgs";
};
zig = {
url = "github:mitchellh/zig-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, globset, fenix, panda, zig }:
let
system = "x86_64-linux";
overlays = [ fenix.overlays.default ];
pkgs = import nixpkgs { inherit system overlays; };
pandaPkgs = panda.packages.${system}.pkgsWithConfig {
configFile = ./config.panda;
targetList = [ "x86_64-softmmu" ];
};
qemu-suvi = (pkgs.callPackage ./nix/qemu.nix {
# Disable most features.
guestAgentSupport = false;
numaSupport = false;
seccompSupport = false;
alsaSupport = false;
pulseSupport = false;
sdlSupport = false;
jackSupport = false;
gtkSupport = false;
vncSupport = false;
smartcardSupport = false;
spiceSupport = false;
usbredirSupport = false;
libiscsiSupport = false;
tpmSupport = false;
canokeySupport = false;
enableDocs = false;
hostCpuTargets = [ "x86_64-softmmu" ];
}).overrideAttrs (final: prev: {
pname = "qemu-suvi";
patches = prev.patches ++ [
./qemu.patch
];
configureFlags = prev.configureFlags ++ [
"--enable-debug"
"--enable-plugins"
];
});
suvi-rust = pkgs.callPackage ./nix/suvi-rust.nix {
inherit globset qemu-suvi;
};
suvi = pkgs.callPackage ./nix/suvi.nix {
inherit globset qemu-suvi suvi-rust;
inherit (pandaPkgs) panda pypanda;
};
hypercall = pkgs.callPackage ./hypercall/default.nix { };
fs-dump = pkgs.callPackage ./fs-testing/fs-dump/default.nix {
inherit globset;
};
jlang = pkgs.callPackage ./fs-testing/ace/jlang.nix {
zig015 = zig.packages.${system}."0.15.1";
};
kernels = {
mainline = pkgs.callPackage ./fs-testing/linux/mainline.nix { };
nova = pkgs.callPackage ./fs-testing/linux/nova.nix { };
pmfs = pkgs.callPackage ./fs-testing/linux/pmfs.nix { };
winefs = pkgs.callPackage ./fs-testing/linux/winefs.nix { };
zilpmem = pkgs.callPackage ./fs-testing/linux/zilpmem.nix { };
};
initramfs = pkgs.callPackage ./fs-testing/initramfs/default.nix {
inherit hypercall fs-dump jlang;
};
in
{
packages.${system} = {
default = suvi;
inherit suvi qemu-suvi hypercall fs-dump jlang;
fs-testing = {
inherit kernels initramfs;
vms = pkgs.callPackage ./fs-testing/vms/default.nix {
inherit kernels initramfs;
};
};
};
devShells.${system}.default = pkgs.mkShell {
inputsFrom = with pkgs; [
linux
suvi
suvi-rust
jlang
];
buildInputs = [
pkgs.python3Packages.progress
];
shellHook = ''
# Set up a plugin directory for PANDA
dir=target/panda/x86_64-softmmu/panda/plugins
mkdir -p "$dir"
[[ -e "$dir/panda_suvi_trace.so" ]] || ln -s "../../../../release/libsuvi_panda_plugin.so" "$dir/panda_suvi_trace.so"
export PANDA_DIR="$PWD/target/panda"
export SUVI_PANDA_CMD="$PWD/suvi_panda_plugin/suvi_panda.py"
# QEMU discovery
export QEMU_BIN_DIR="${qemu-suvi}/bin"
# Put python3Full first so that we don't get python3
export PATH="${pkgs.python3Full}/bin:$PATH"
'';
};
};
}