feat: add dev host
This commit is contained in:
parent
cabf453a5d
commit
6d7db643bc
4 changed files with 163 additions and 0 deletions
61
hosts/fw/modules/dev-microvm.nix
Normal file
61
hosts/fw/modules/dev-microvm.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
hostname = "dev";
|
||||
in
|
||||
{
|
||||
microvm.vms.dev = {
|
||||
config = {
|
||||
imports = [
|
||||
../dev/configuration.nix
|
||||
./network-prefix.nix
|
||||
];
|
||||
|
||||
networkPrefix = config.networkPrefix;
|
||||
|
||||
microvm = {
|
||||
mem = 4096;
|
||||
vcpu = 2;
|
||||
|
||||
shares = [
|
||||
{
|
||||
source = "/nix/store";
|
||||
mountPoint = "/nix/.ro-store";
|
||||
tag = "ro-store";
|
||||
proto = "virtiofs";
|
||||
}
|
||||
{
|
||||
source = "/var/lib/microvms/persist/dev";
|
||||
mountPoint = "/persist";
|
||||
tag = "persist";
|
||||
proto = "virtiofs";
|
||||
}
|
||||
{
|
||||
source = "/var/lib/microvms/persist/dev/home";
|
||||
mountPoint = "/home";
|
||||
tag = "home";
|
||||
proto = "virtiofs";
|
||||
}
|
||||
];
|
||||
|
||||
volumes = [{
|
||||
image = "rootfs.img";
|
||||
mountPoint = "/";
|
||||
size = 51200;
|
||||
}];
|
||||
|
||||
interfaces = [{
|
||||
type = "tap";
|
||||
id = "vm-${hostname}";
|
||||
mac = "02:00:00:00:02:01";
|
||||
}];
|
||||
};
|
||||
|
||||
systemd.network.networks."10-lan" = {
|
||||
matchConfig.PermanentMACAddress = "02:00:00:00:02:01";
|
||||
address = [ "${config.networkPrefix}.97.15/24" ];
|
||||
gateway = [ "${config.networkPrefix}.97.1" ];
|
||||
dns = [ "${config.networkPrefix}.97.1" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue