2022-05-04 17:27:07 +00:00
|
|
|
pkgs:
|
2022-06-29 21:01:30 +00:00
|
|
|
let
|
|
|
|
qemu-opts = builtins.concatStringsSep " " [
|
|
|
|
"${pkgs.qemu_kvm}/bin/qemu-kvm"
|
|
|
|
"-cpu host"
|
|
|
|
"-usbdevice tablet"
|
2022-08-03 19:25:16 +00:00
|
|
|
"-smp cores=4"
|
2022-06-29 21:01:30 +00:00
|
|
|
"-m 4096"
|
|
|
|
];
|
|
|
|
|
|
|
|
in
|
2022-06-29 18:55:21 +00:00
|
|
|
builtins.mapAttrs
|
|
|
|
(n: v: {
|
|
|
|
type = "app";
|
|
|
|
program = toString (pkgs.writeShellScript n v);
|
|
|
|
})
|
2022-05-04 17:27:07 +00:00
|
|
|
{
|
|
|
|
jupyterlab =
|
|
|
|
let
|
|
|
|
jupy = pkgs.python3.withPackages (p: with p; [ jupyterlab ipython ]);
|
|
|
|
in
|
2022-06-29 18:55:21 +00:00
|
|
|
''
|
2022-05-04 17:27:07 +00:00
|
|
|
exec ${jupy}/bin/python -m jupyterlab "$@"
|
|
|
|
'';
|
|
|
|
|
2022-06-29 21:01:30 +00:00
|
|
|
qemu-bios = ''
|
|
|
|
exec ${qemu-opts} "$@"
|
|
|
|
'';
|
|
|
|
|
2022-06-29 18:55:21 +00:00
|
|
|
qemu-uefi = ''
|
2022-06-29 21:01:30 +00:00
|
|
|
exec ${qemu-opts} -bios ${pkgs.OVMF.fd}/FV/OVMF.fd "$@"
|
2022-05-04 17:27:07 +00:00
|
|
|
'';
|
|
|
|
}
|