idek what i did to fix this
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
1c596593ca
commit
eba9d9c4cd
@ -3,14 +3,16 @@ rec {
|
|||||||
genK3SVM =
|
genK3SVM =
|
||||||
server-config: agent-config: vms:
|
server-config: agent-config: vms:
|
||||||
lib.mapAttrs (
|
lib.mapAttrs (
|
||||||
host: {ipv4,server ? false}:
|
host:
|
||||||
genMicroVM host ipv4 "x86_64-linux" (
|
{
|
||||||
if server then (import server-config) else (import agent-config)
|
ipv4,
|
||||||
)
|
server ? false,
|
||||||
|
}:
|
||||||
|
genMicroVM host ipv4 "x86_64-linux" (if server then server-config else agent-config)
|
||||||
) vms;
|
) vms;
|
||||||
|
|
||||||
genMicroVM =
|
genMicroVM =
|
||||||
hostName: ipv4: system: vm-config:
|
hostName: ipv4: _system: vm-config:
|
||||||
# microvm refers to microvm.nixosModules
|
# microvm refers to microvm.nixosModules
|
||||||
|
|
||||||
# {
|
# {
|
||||||
@ -30,6 +32,7 @@ rec {
|
|||||||
# The configuration for the MicroVM.
|
# The configuration for the MicroVM.
|
||||||
# Multiple definitions will be merged as expected.
|
# Multiple definitions will be merged as expected.
|
||||||
config = {
|
config = {
|
||||||
|
imports = [ vm-config ];
|
||||||
# It is highly recommended to share the host's nix-store
|
# It is highly recommended to share the host's nix-store
|
||||||
# with the VMs to prevent building huge images.
|
# with the VMs to prevent building huge images.
|
||||||
microvm.shares = [
|
microvm.shares = [
|
||||||
@ -43,14 +46,16 @@ rec {
|
|||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
inherit hostName;
|
inherit hostName;
|
||||||
interfaces.ether.ipv4.addreses = {
|
interfaces.ether.ipv4.addresses = [
|
||||||
|
{
|
||||||
address = ipv4;
|
address = ipv4;
|
||||||
prefixLength = 32;
|
prefixLength = 32;
|
||||||
};
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Any other configuration for your MicroVM
|
# Any other configuration for your MicroVM
|
||||||
# [...]
|
# [...]
|
||||||
} // vm-config;
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -22,13 +22,13 @@ in
|
|||||||
microvm.vms = cfg.vms;
|
microvm.vms = cfg.vms;
|
||||||
|
|
||||||
# TODO: deprecate this once we have syslog forwarders
|
# TODO: deprecate this once we have syslog forwarders
|
||||||
systemd.tmpfiles.rules = map (
|
# systemd.tmpfiles.rules = map (
|
||||||
vmHost:
|
# vmHost:
|
||||||
let
|
# let
|
||||||
machineId = lib.addresses.machineId.${vmHost};
|
# machineId = lib.addresses.machineId.${vmHost};
|
||||||
in
|
# in
|
||||||
# creates a symlink of each MicroVM's journal under the host's /var/log/journal
|
# # creates a symlink of each MicroVM's journal under the host's /var/log/journal
|
||||||
"L+ /var/log/journal/${machineId} - - - - /var/lib/microvms/${vmHost}/journal/${machineId}"
|
# "L+ /var/log/journal/${machineId} - - - - /var/lib/microvms/${vmHost}/journal/${machineId}"
|
||||||
) (builtins.attrNames lib.addresses.machineId);
|
# ) (builtins.attrNames lib.addresses.machineId);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user