1
0
forked from public/Gradient
Gradient/nix/vm
2024-11-27 02:57:03 +01:00
..
monitoring Some very basic monitoring. 2024-11-27 02:57:03 +01:00
nginx Some very basic monitoring. 2024-11-27 02:57:03 +01:00
base.nix Some basic monitoring example, for the test VM. 2024-11-10 21:32:50 +01:00
defaults.nix update postgresql dev setup 2024-11-07 02:00:02 +01:00
mDNS.nix Refractured br0 interface and made it possible to connect with gradient-dev.local from LAN. 2024-11-10 17:10:23 +01:00
postgresql.nix Fixed typo. 2024-11-10 17:45:42 +01:00
README.md Some basic monitoring example, for the test VM. 2024-11-10 21:32:50 +01:00

Setup an virtual bridge interface, according to this document.

Import the following config to allow the VM to connect to the Internet and you be able to open the postgres DB.

{ ... }:
{
  systemd.network = {
    netdevs = {
      # Create the bridge interface
      "20-virbr0" = {
        bridgeConfig.STP = true;
        netdevConfig = {
          Kind = "bridge";
          Name = "virbr0";
        };
      };
    };
    networks = {
      # Connect the bridge ports to the bridge
      "30-skyflake" = {
        matchConfig.Name = [
          "enp*"
          "vm-*"
       ];
       bridge = [ "virbr0" ];
       linkConfig.RequiredForOnline = "enslaved";
      };
      # Configure the bridge for its desired function
      "40-virbr0" = {
        name = "virbr0";
        DHCP = "yes";
        bridgeConfig = {};
        # Disable address autoconfig when no IP configuration is required
        networkConfig.LinkLocalAddressing = "no";
        linkConfig = {
          # or "routable" with IP addresses configured
          RequiredForOnline = "routable";
        };
      };
    };
  };
}

Connecting to the VM

connect with psql -U postgres -h ${IP_OF_VM} or use the domain gradient-dev.local