From 504b765606f02b610d74d259ddf2c85292e1f6c0 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sat, 8 Feb 2025 03:19:30 -0800 Subject: add nix-topology; make configuration options less bad; restructure project a bit; add flake system looping --- nix/topology/default.nix | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 nix/topology/default.nix (limited to 'nix/topology/default.nix') diff --git a/nix/topology/default.nix b/nix/topology/default.nix new file mode 100644 index 0000000..ce0b3a4 --- /dev/null +++ b/nix/topology/default.nix @@ -0,0 +1,59 @@ +{ config, ... }: +let + inherit + (config.lib.topology); +in +{ + # Connect node1.lan -> node2.wan + nodes = { + spontaneity = { + interfaces.wan.network = "remote"; + }; + + installer = { + interfaces.lan.network = "home"; + }; + + affinity = { + interfaces.lan = { + network = "home"; + physicalConnections = [ + { + node = "spontaneity"; + interface = "wan"; + } + { + node = "installer"; + interface = "lan"; + } + ]; + }; + }; + continuity = { + interfaces.lan = { + network = "home"; + physicalConnections = [ + { + node = "spontaneity"; + interface = "wan"; + } + { + node = "affinity"; + interface = "lan"; + } + ]; + }; + }; + }; + + networks = { + home = { + name = "Home Network"; + cidrv4 = "192.168.1.1/24"; + }; + remote = { + name = "Remote Network"; + cidrv4 = "144.202.27.169/32"; + }; + }; +} -- cgit