-
-
Notifications
You must be signed in to change notification settings - Fork 480
/
devshell.nix
50 lines (48 loc) · 1.11 KB
/
devshell.nix
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
{ lib,
mkShell,
pkgs,
stdenv,
}:
mkShell {
packages = with pkgs; ([
cdrtools
curl
gawk
gnugrep
gnused
jq
pciutils
procps
python3
qemu_full
samba
socat
spice-gtk
swtpm
unzip
util-linux
xorg.xrandr
zsync
OVMF
OVMFFull
] ++ lib.optionals stdenv.isLinux [
glxinfo
usbutils
xdg-user-dirs
]);
inputsFrom = with pkgs; [
git
];
shellHook = ''
echo "**********************************************************************"
echo "* 'direnv reload' to update '.direnv/bin/quickemu' for testing *"
echo "**********************************************************************"
sed \
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${pkgs.OVMFFull.firmware}","${pkgs.OVMFFull.variables}" |' \
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${pkgs.OVMF.firmware}","${pkgs.OVMF.variables}" |' \
-e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \
-e 's,\$(command -v smbd),${pkgs.samba}/bin/smbd,' \
quickemu > $PWD/.direnv/bin/quickemu
chmod +x $PWD/.direnv/bin/quickemu
'';
}