diff options
Diffstat (limited to 'modules/snorlax')
-rw-r--r-- | modules/snorlax/default.nix | 2 | ||||
-rw-r--r-- | modules/snorlax/uvm-guests/cpanel.nix | 36 | ||||
-rw-r--r-- | modules/snorlax/uvm-guests/default.nix | 4 | ||||
-rw-r--r-- | modules/snorlax/uvm.nix | 6 |
4 files changed, 41 insertions, 7 deletions
diff --git a/modules/snorlax/default.nix b/modules/snorlax/default.nix index 11deb13..5266987 100644 --- a/modules/snorlax/default.nix +++ b/modules/snorlax/default.nix @@ -5,7 +5,7 @@ ./git.nix ./samba.nix ./nginx.nix - ./uvm.nix + ./uvm-guests ./networking.nix ../core diff --git a/modules/snorlax/uvm-guests/cpanel.nix b/modules/snorlax/uvm-guests/cpanel.nix new file mode 100644 index 0000000..51bc0d2 --- /dev/null +++ b/modules/snorlax/uvm-guests/cpanel.nix @@ -0,0 +1,36 @@ +{ pkgs, ... }: +{ + 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 = {}; + + # The configuration for the MicroVM. + # Multiple definitions will be merged as expected. + config = { + networking.hostName = "cpanel"; + + # 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 = "bridge"; + }]; + + # Any other configuration for your MicroVM + # [...] + }; + }; + }; +} diff --git a/modules/snorlax/uvm-guests/default.nix b/modules/snorlax/uvm-guests/default.nix new file mode 100644 index 0000000..39b0611 --- /dev/null +++ b/modules/snorlax/uvm-guests/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./cpanel.nix ]; +} diff --git a/modules/snorlax/uvm.nix b/modules/snorlax/uvm.nix deleted file mode 100644 index 9abd85a..0000000 --- a/modules/snorlax/uvm.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - microvm.autostart = [ - "test1" - ]; -} |