Add a qemu port of my bhyverc script for running virtual machines on Linux.
This commit is contained in:
@@ -5,6 +5,41 @@
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
qemurc =
|
||||
(pkgs.writeScriptBin "qemurc" (
|
||||
builtins.readFile (
|
||||
pkgs.replaceVars ./files/qemurc.bash {
|
||||
"OVMFfd" = "${pkgs.OVMF.fd}";
|
||||
mount_root = "/vm";
|
||||
zfs_root = "zroot/linux/nix/vm";
|
||||
}
|
||||
)
|
||||
)).overrideAttrs
|
||||
(old: {
|
||||
buildCommand = ''
|
||||
${old.buildCommand}
|
||||
patchShebangs $out
|
||||
'';
|
||||
});
|
||||
qemurc_wrapped =
|
||||
(pkgs.writeScriptBin "qemurc" ''
|
||||
#!/usr/bin/env bash
|
||||
export "PATH=${
|
||||
lib.makeBinPath [
|
||||
pkgs.swtpm
|
||||
pkgs.tmux
|
||||
]
|
||||
}:''${PATH}"
|
||||
exec ${qemurc}/bin/qemurc "''${@}"
|
||||
'').overrideAttrs
|
||||
(old: {
|
||||
buildCommand = ''
|
||||
${old.buildCommand}
|
||||
patchShebangs $out
|
||||
'';
|
||||
});
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
@@ -22,6 +57,7 @@
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
qemu
|
||||
qemurc_wrapped
|
||||
];
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user