From 65c2b30a288385cf3df4027d50080ac595bbcf83 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 2 Apr 2020 23:45:04 -0700 Subject: Reorganize and comment some of the nix code --- Com/Simatime/Cloud/networking.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Com/Simatime/Cloud/networking.nix (limited to 'Com/Simatime/Cloud/networking.nix') diff --git a/Com/Simatime/Cloud/networking.nix b/Com/Simatime/Cloud/networking.nix new file mode 100644 index 0000000..0df42e3 --- /dev/null +++ b/Com/Simatime/Cloud/networking.nix @@ -0,0 +1,36 @@ +{ lib, config, ... }: + +{ + networking = { + + firewall = { + allowedTCPPorts = [ 22 80 443 ]; + allowPing = true; + }; + + # This following was populated at runtime with the networking details + # gathered from the active system. + nameservers = [ + "67.207.67.2" + "67.207.67.3" + ]; + defaultGateway = "159.89.128.1"; + defaultGateway6 = ""; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce true; + interfaces = { + eth0 = { + ipv4.addresses = [ + { address="159.89.128.69"; prefixLength=20; } + { address="10.46.0.6"; prefixLength=16; } + ]; + ipv6.addresses = [ + { address="fe80::e899:c0ff:fe9c:e194"; prefixLength=64; } + ]; + }; + }; + }; + services.udev.extraRules = '' + ATTR{address}=="ea:99:c0:9c:e1:94", NAME="eth0" + ''; +} -- cgit v1.2.3