diff --git a/flake.lock b/flake.lock index dba4755..b962433 100644 --- a/flake.lock +++ b/flake.lock @@ -978,11 +978,11 @@ "treefmt-nix": "treefmt-nix_3" }, "locked": { - "lastModified": 1724916929, - "narHash": "sha256-QM8qdmnENvNGvfhLv0LsQsZgIot75Q7R8QV0Mm5I5yM=", + "lastModified": 1725014015, + "narHash": "sha256-MFumiomiSQopOPcQgaBsqIRQZ8q2BJiEOm7bGomuu1U=", "ref": "main", - "rev": "82083225da7402d2bde9cfd3172374a96429b579", - "revCount": 72, + "rev": "8a828064a794b75eb2459c6be499bef740c32721", + "revCount": 74, "type": "git", "url": "ssh://forgejo@git.ingolf-wagner.de/palo/nixos-private-parts.git" }, diff --git a/flake.nix b/flake.nix index a52c21e..c0344ee 100644 --- a/flake.nix +++ b/flake.nix @@ -342,7 +342,7 @@ clan-core.flakeModules.default ./nix/formatter.nix ./nix/packages - ./nix/topology.nix + ./nix/topology ]; # Define your clan diff --git a/machines/cherry/configuration.nix b/machines/cherry/configuration.nix index 8ab0631..f800a9c 100644 --- a/machines/cherry/configuration.nix +++ b/machines/cherry/configuration.nix @@ -18,6 +18,7 @@ ./network-wireguard-wg1.nix ./37c3.nix + ./topology.nix ]; diff --git a/machines/cherry/topology.nix b/machines/cherry/topology.nix new file mode 100644 index 0000000..59218f3 --- /dev/null +++ b/machines/cherry/topology.nix @@ -0,0 +1,22 @@ +{ config, ... }: +with config.lib.topology; +{ + topology.self = { + + interfaces.wg0 = { + network = "wg0"; + type = "ethernet"; + virtual = true; + }; + interfaces.ztbn67ogn2 = { + network = "wg0"; + type = "ethernet"; + virtual = true; + }; + interfaces."tinc.private" = { + network = "tinc.private"; + type = "ethernet"; + virtual = true; + }; + }; +} diff --git a/machines/chungus/configuration.nix b/machines/chungus/configuration.nix index f82d867..9fe7064 100644 --- a/machines/chungus/configuration.nix +++ b/machines/chungus/configuration.nix @@ -52,6 +52,8 @@ ./zerotier-controller.nix + ./topology.nix + ]; components.gui.enable = false; diff --git a/machines/chungus/topology.nix b/machines/chungus/topology.nix new file mode 100644 index 0000000..8bda2bb --- /dev/null +++ b/machines/chungus/topology.nix @@ -0,0 +1,33 @@ +{ config, ... }: +with config.lib.topology; +{ + topology.self = { + + interfaces.enp0s31f6 = { + network = "home"; + type = "ethernet"; + }; + interfaces.wg0 = { + addresses = [ "10.100.0.2" ]; + network = "wg0"; + type = "ethernet"; + virtual = true; + }; + interfaces.ztbn67ogn2 = { + network = "wg0"; + type = "ethernet"; + virtual = true; + }; + interfaces."tinc.private" = { + network = "tinc.private"; + type = "ethernet"; + virtual = true; + }; + interfaces."tinc.retiolum" = { + network = "tinc.retiolum"; + type = "ethernet"; + virtual = true; + }; + + }; +} diff --git a/machines/orbi/configuration.nix b/machines/orbi/configuration.nix index ae920c1..f6bb6ec 100644 --- a/machines/orbi/configuration.nix +++ b/machines/orbi/configuration.nix @@ -41,6 +41,8 @@ #./social-jitsi.nix ./social-matrix-terranix.nix + ./topology.nix + ]; services.logrotate.checkConfig = false; # because uid 3000 does not exist in here diff --git a/machines/orbi/topology.nix b/machines/orbi/topology.nix new file mode 100644 index 0000000..24e8306 --- /dev/null +++ b/machines/orbi/topology.nix @@ -0,0 +1,28 @@ +{ config, ... }: +with config.lib.topology; +{ + topology.self = { + + # interfaces.enp0s31f6 = { + # network = "home"; # internet + # type = "ethernet"; + # }; + interfaces.wg0 = { + addresses = [ "10.100.0.1" ]; + network = "wg0"; + type = "ethernet"; + virtual = true; + }; + interfaces.ztbn67ogn2 = { + network = "wg0"; + type = "ethernet"; + virtual = true; + }; + interfaces."tinc.private" = { + network = "tinc.private"; + type = "ethernet"; + virtual = true; + }; + + }; +} diff --git a/nix/topology.nix b/nix/topology/default.nix similarity index 97% rename from nix/topology.nix rename to nix/topology/default.nix index fa2eba3..d72a838 100644 --- a/nix/topology.nix +++ b/nix/topology/default.nix @@ -31,6 +31,7 @@ overlays = [ inputs.nix-topology.overlays.default ]; }; topology.modules = [ + ./networks.nix { # Inline module to inform topology of your existing NixOS hosts. } diff --git a/nix/topology/networks.nix b/nix/topology/networks.nix new file mode 100644 index 0000000..e7a3eb4 --- /dev/null +++ b/nix/topology/networks.nix @@ -0,0 +1,20 @@ +{ config, ... }: +with config.lib.topology; +{ + + networks.wg0 = { + name = "wg0"; + cidrv4 = "10.100.0.0/24"; + }; + + networks."tinc.private" = { + name = "tinc private"; + cidrv4 = "10.23.42.0/24"; + }; + + networks."tinc.retiolum" = { + name = "tinc retiolum"; + #cidrv4 = "192.168.0.0/24"; + }; + +}