split network configuration from default.nix
This commit is contained in:
parent
84af935331
commit
cad10a31eb
|
@ -4,21 +4,10 @@
|
|||
../../modules/base
|
||||
../../modules/server
|
||||
./hardware.nix
|
||||
./network.nix
|
||||
];
|
||||
|
||||
networking.hostName = "alpha";
|
||||
systemd.network.networks = {
|
||||
"10-lan" = {
|
||||
name = "enp1s0";
|
||||
networkConfig.DHCP = "ipv4";
|
||||
address = [
|
||||
"2a01:4f8:c2c:71c0::/64"
|
||||
];
|
||||
routes = [
|
||||
{ routeConfig = { Gateway = "fe80::1"; }; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
|
|
14
hosts/alpha/network.nix
Normal file
14
hosts/alpha/network.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ ... }: {
|
||||
systemd.network.networks = {
|
||||
"10-lan" = {
|
||||
name = "enp1s0";
|
||||
networkConfig.DHCP = "ipv4";
|
||||
address = [
|
||||
"2a01:4f8:c2c:71c0::/64"
|
||||
];
|
||||
routes = [
|
||||
{ routeConfig = { Gateway = "fe80::1"; }; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,25 +5,11 @@
|
|||
../../modules/server
|
||||
../../modules/tor
|
||||
./hardware.nix
|
||||
./network.nix
|
||||
./tor.nix
|
||||
];
|
||||
|
||||
networking.hostName = "tor";
|
||||
systemd.network.networks = {
|
||||
"10-lan" = {
|
||||
# IPv4 settings are from `sudo dhcpcd --test`.
|
||||
# IPv6 settings are from https://www.ssdvps.dk/knowledgebase/18/IPv6-Gateway.html.
|
||||
name = "ens3";
|
||||
address = [
|
||||
"91.210.59.57/25"
|
||||
"2a0d:3e83:1:b284::1/64"
|
||||
];
|
||||
routes = [
|
||||
{ routeConfig = { Gateway = "91.210.59.1"; }; }
|
||||
{ routeConfig = { Gateway = "2a0d:3e83:1::1"; GatewayOnLink = true; }; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
|
|
17
hosts/tor/network.nix
Normal file
17
hosts/tor/network.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ ... }: {
|
||||
systemd.network.networks = {
|
||||
"10-lan" = {
|
||||
# IPv4 settings are from `sudo dhcpcd --test`.
|
||||
# IPv6 settings are from https://www.ssdvps.dk/knowledgebase/18/IPv6-Gateway.html.
|
||||
name = "ens3";
|
||||
address = [
|
||||
"91.210.59.57/25"
|
||||
"2a0d:3e83:1:b284::1/64"
|
||||
];
|
||||
routes = [
|
||||
{ routeConfig = { Gateway = "91.210.59.1"; }; }
|
||||
{ routeConfig = { Gateway = "2a0d:3e83:1::1"; GatewayOnLink = true; }; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue