mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
feat: add declarative microvms
This commit is contained in:
parent
1a7472207a
commit
1b9d9fc58a
8 changed files with 124 additions and 80 deletions
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
microvm,
|
||||
nixos-hardware,
|
||||
pkgs,
|
||||
...
|
||||
|
@ -8,6 +11,8 @@
|
|||
nixos-hardware.common-cpu-intel
|
||||
nixos-hardware.common-pc-ssd
|
||||
|
||||
microvm.host
|
||||
|
||||
../common/core
|
||||
../common/hardware/intel.nix
|
||||
../common/hardware/physical.nix
|
||||
|
@ -23,6 +28,22 @@
|
|||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" "r8169"];
|
||||
|
||||
microvm.vms = {
|
||||
test = let
|
||||
node =
|
||||
(import ../../nix/generate-node.nix inputs)
|
||||
"ward-microvm-test" {
|
||||
system = "x86_64-linux";
|
||||
config = ./microvms/test;
|
||||
};
|
||||
in {
|
||||
inherit (node) pkgs specialArgs;
|
||||
config = {
|
||||
inherit (node) imports;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#services.authelia.instances.main = {
|
||||
# enable = true;
|
||||
# settings = {
|
||||
|
|
28
hosts/ward/microvms/test/default.nix
Normal file
28
hosts/ward/microvms/test/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
microvm,
|
||||
nixos-hardware,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
microvm.microvm
|
||||
|
||||
../../../common/core
|
||||
|
||||
../../../../users/root
|
||||
];
|
||||
|
||||
systemd.network.networks = {
|
||||
"10-wan" = {
|
||||
# TODO
|
||||
matchConfig.Name = "en*";
|
||||
DHCP = "yes";
|
||||
networkConfig.IPv6PrivacyExtensions = "kernel";
|
||||
dhcpV4Config.RouteMetric = 20;
|
||||
dhcpV6Config.RouteMetric = 20;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue