This commit is contained in:
shelvacu
2024-06-28 16:18:38 -07:00
parent 4d4a6c13cc
commit 64c6bcbe7a
2 changed files with 27 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
./mail.nix
./dkim.nix
./sieve.nix
./network.nix
];
options = let

26
liam/network.nix Normal file
View File

@@ -0,0 +1,26 @@
{ lib, ... }: let
# from `curl -fsSL http://169.254.169.254/metadata/v1.json | jq '.interfaces.public[0].anchor_ipv4'`
# {
# "ip_address": "10.46.0.7",
# "netmask": "255.255.0.0",
# "gateway": "10.46.0.1"
# }
interface_conf = {
useDHCP = true;
ipv4.addresses = [{
address = "10.46.0.7";
prefixLength = 24;
}];
ipv4.routes = [{
address = "0.0.0.0";
prefixLength = 0;
via = "10.46.0.1";
options.scope = "global";
options.src = "10.46.0.7";
options.metric = "1200";
}];
};
in {
networking.interfaces."ens3" = lib.mkIf (!config.vacu.underTest) interface_conf;
networking.interfaces."eth0" = lib.mkIf ( config.vacu.underTest) interface_conf;
};