add headscale, eth clients to htz

This commit is contained in:
iofq 2024-02-04 01:57:41 -06:00
parent 4293324f36
commit 1849fdc496
No known key found for this signature in database
GPG key ID: ECF3B2DA38BF7183
15 changed files with 289 additions and 417 deletions

View file

@ -1,44 +1,8 @@
{
lib,
pkgs,
addressList,
...
}: let
genVMConfig = {
name,
config ? {},
ro-store ? true,
}: {
restartIfChanged = true;
inherit pkgs;
config =
config
// {
microvm = {
shares = lib.mkIf ro-store [
{
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "ro-store";
proto = "virtiofs";
}
];
interfaces = [
{
type = "tap";
id = name;
inherit (addressList.${name}) mac;
}
];
};
}
// import ./vmDefaults.nix {inherit name addressList;};
};
in {
_: {
microvm.vms = {
vm-test = genVMConfig {
name = "vm-test";
config = import ./vm-test.nix {inherit pkgs addressList;};
};
# vm-headscale = genVMConfig {
# name = "vm-headscale";
# config = import ./headscale.nix { inherit config; };
# };
};
}