Fediversity/infra/common/nixos/networking.nix

64 lines
1.3 KiB
Nix
Raw Permalink Normal View History

{ config, lib, ... }:
let
inherit (lib) mkDefault;
in
{
config = {
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
networking = {
hostName = config.procolixVm.name;
domain = config.procolixVm.domain;
2024-11-20 15:51:09 +01:00
2024-11-20 16:48:36 +01:00
## REVIEW: Do we actually need that, considering that we have static IPs?
useDHCP = mkDefault true;
interfaces = {
eth0 = {
ipv4 = {
addresses = [
{
inherit (config.procolixVm.ipv4) address prefixLength;
}
];
};
ipv6 = {
addresses = [
{
inherit (config.procolixVm.ipv6) address prefixLength;
}
];
};
};
};
2024-11-20 15:51:09 +01:00
defaultGateway = {
address = config.procolixVm.ipv4.gateway;
interface = "eth0";
};
defaultGateway6 = {
address = config.procolixVm.ipv6.gateway;
interface = "eth0";
};
2024-11-20 15:51:09 +01:00
nameservers = [
"95.215.185.6"
"95.215.185.7"
"2a00:51c0::5fd7:b906"
2024-11-21 11:32:48 +01:00
"2a00:51c0::5fd7:b907"
];
2024-11-20 15:51:09 +01:00
firewall.enable = false;
nftables = {
enable = true;
2024-11-20 15:51:09 +01:00
rulesetFile = ./nftables-ruleset.nft;
};
};
};
}