diff options
author | Jasper Ras <jaspert.ras@gmail.com> | 2025-03-29 12:54:20 +0100 |
---|---|---|
committer | Jasper Ras <jaspert.ras@gmail.com> | 2025-03-29 12:54:20 +0100 |
commit | 5bf105b94f3c63bc738b788b2b651985eed96c11 (patch) | |
tree | c8b98b552fede2854fdc9ebf59f8a030ebd7e3cd /nodes/snorlax/uvm-guests | |
parent | 5b41ca762c6a44fa7a77e5f5324bcecf8a47f4c7 (diff) |
dynamic nodes
Diffstat (limited to 'nodes/snorlax/uvm-guests')
-rw-r--r-- | nodes/snorlax/uvm-guests/cpanel.nix | 62 | ||||
-rw-r--r-- | nodes/snorlax/uvm-guests/default.nix | 4 |
2 files changed, 66 insertions, 0 deletions
diff --git a/nodes/snorlax/uvm-guests/cpanel.nix b/nodes/snorlax/uvm-guests/cpanel.nix new file mode 100644 index 0000000..b7fb4c3 --- /dev/null +++ b/nodes/snorlax/uvm-guests/cpanel.nix @@ -0,0 +1,62 @@ +{ inputs, ... }: +{ + microvm.autostart = [ "cpanel" ]; + microvm.vms = { + cpanel = { + # The package set to use for the microvm. This also determines the microvm's architecture. + # Defaults to the host system's package set if not given. + # pkgs = import pkgs { system = "x86_64-linux"; }; + + # (Optional) A set of special arguments to be passed to the MicroVM's NixOS modules. + specialArgs = { inherit inputs; }; + + # The configuration for the MicroVM. + # Multiple definitions will be merged as expected. + config = { + + networking.hostName = "cpanel"; + systemd.network.enable = true; + systemd.network.networks."20-lan" = { + matchConfig.Type = "ether"; + networkConfig = { + # Address = ["192.168.50.3/24" "2001:db8::b/64"]; + Gateway = "192.168.50.1"; + DNS = ["192.168.50.1"]; + IPv6AcceptRA = true; + DHCP = "yes"; + }; + }; + + home-manager.users.jras.home.stateVersion = "24.11"; + + imports = [ + inputs.home-manager.nixosModules.home-manager + inputs.disko.nixosModules.disko + inputs.nixos-facter-modules.nixosModules.facter + ../../core/users.nix + ../../core/packages.nix + ../../core/services.nix + ]; + + + # It is highly recommended to share the host's nix-store + # with the VMs to prevent building huge images. + microvm.shares = [{ + source = "/nix/store"; + mountPoint = "/nix/.ro-store"; + tag = "ro-store"; + proto = "virtiofs"; + }]; + + microvm.interfaces = [{ + type = "tap"; + id = "cpanel"; + mac = "02:00:00:00:00:01"; + }]; + + # Any other configuration for your MicroVM + # [...] + }; + }; + }; +} diff --git a/nodes/snorlax/uvm-guests/default.nix b/nodes/snorlax/uvm-guests/default.nix new file mode 100644 index 0000000..39b0611 --- /dev/null +++ b/nodes/snorlax/uvm-guests/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./cpanel.nix ]; +} |