nix/nixos/consensus/hypervisor/default.nix
iofq 77164adab6
Some checks are pending
/ check (push) Waiting to run
dec
2025-12-17 23:59:17 -06:00

37 lines
765 B
Nix

{ lib, pkgs, ... }:
let
attrs = {
forgejo-runner = {
ipv4 = "10.0.0.2";
subnet = "/24";
mac = "02:00:00:00:00:01";
};
};
genVMConfig = name: addr: {
restartIfChanged = true;
pkgs = pkgs;
config = {
microvm = {
shares = lib.mkIf (addr.ro-store == true) [
{
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "ro-store";
proto = "virtiofs";
}
];
interfaces = [
{
type = "tap";
id = name;
mac = attrs.${name}.mac;
}
];
};
}
// import ./configuration.nix { inherit name attrs; };
};
in
{
microvm.vms = lib.mapAttrs genVMConfig attrs;
}