parent
3f81a20e87
commit
77164adab6
12 changed files with 412 additions and 485 deletions
37
nixos/consensus/hypervisor/default.nix
Normal file
37
nixos/consensus/hypervisor/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue