diff options
author | aszlig <aszlig@redmoonstudios.org> | 2015-01-30 09:44:18 +0100 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2015-01-30 09:44:18 +0100 |
commit | d64ed6fb4fd211f9690b359275371926246f4521 (patch) | |
tree | 600d2e23ab2ca4f84c8409ae7c82a48b2067e61b /redmoon-static.nix | |
parent | 51ef031d78c7c04db9e105d7909973547f6ecdcf (diff) |
Add a static configuration for redmoon network.
Today seems to be a "bad luck day" because my Sheeva Plug just died. So I'm back to some weird stupid old Netgear thingy that seems to be so old that it doesn't even know what IPv6 "might be". And it's already the "latest and gro^Heatest" firmware that's available. One of the ugly things is that our internal DNS configuration can't be done using that stupid thing, because it uses DHCP to assign external DNS servers rather than having an internal DNS forwarder where you can assign your own[TM] zones. So let's hope that we can revert this in the foreseeable future. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'redmoon-static.nix')
-rw-r--r-- | redmoon-static.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/redmoon-static.nix b/redmoon-static.nix new file mode 100644 index 00000000..225af8f1 --- /dev/null +++ b/redmoon-static.nix @@ -0,0 +1,30 @@ +{ config, lib, ... }: + +let + hostMap = { + spaghetti.ipv4 = "192.168.1.1"; + mmrnmhrm.ipv4 = "192.168.1.20"; + dnyarri.ipv4 = "192.168.1.32"; + + mmrnmhrm.device = "enp4s0"; + dnyarri.device = "enp0s25"; + }; + + hostcfg = hostMap.${config.networking.hostName}; + +in { + # Workaround for my temporary stupid fscking non-IPv6 NAT gateway... + networking.domain = "redmoon"; + networking.nameservers = [ "212.18.0.5" "212.18.3.5" ]; + networking.defaultGateway = "192.168.1.1"; + networking.interfaces.${hostcfg.device} = { + ipAddress = hostcfg.ipv4; + prefixLength = 24; + }; + + networking.extraHosts = let + hostList = lib.mapAttrsToList (name: { ipv4, ... }: '' + ${ipv4} ${name} ${name}.redmoon + '') hostMap; + in lib.concatStrings hostList; +} |