summaryrefslogtreecommitdiff
path: root/nodes/snorlax/uvm-guests/cpanel.nix
blob: b7fb4c3beb1b9cbaac7efafed46c246927d02908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
        # [...]
      };
    };
  };
}