nixos/hosts/microserver.home.ts.hillion.co.uk/default.nix

49 lines
1.1 KiB
Nix
Raw Normal View History

2022-10-22 22:18:32 +01:00
{ config, pkgs, lib, ... }:
{
imports = [
./hardware-configuration.nix
2022-10-22 22:18:32 +01:00
../../modules/common/default.nix
2023-01-02 21:50:11 +00:00
../../modules/rpi/rpi4.nix
2022-10-22 22:18:32 +01:00
];
2023-04-17 21:22:04 +01:00
config = {
system.stateVersion = "22.05";
networking.hostName = "microserver";
networking.domain = "home.ts.hillion.co.uk";
# Networking
## Tailscale
age.secrets."tailscale/microserver.home.ts.hillion.co.uk".file = ../../secrets/tailscale/microserver.home.ts.hillion.co.uk.age;
custom.tailscale = {
enable = true;
preAuthKeyFile = config.age.secrets."tailscale/microserver.home.ts.hillion.co.uk".path;
advertiseRoutes = [ "10.64.50.0/24" "10.239.19.0/24" ];
advertiseExitNode = true;
2022-10-22 22:18:32 +01:00
};
2023-04-17 21:22:04 +01:00
## Enable IoT VLAN
networking.vlans = {
vlan2 = {
id = 2;
interface = "eth0";
};
};
## Enable IP forwarding for Tailscale
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = true;
};
2023-04-17 21:22:04 +01:00
## Run a persistent iperf3 server
services.iperf3.enable = true;
services.iperf3.openFirewall = true;
2023-06-19 20:00:33 +01:00
networking.firewall.interfaces."tailscale0".allowedTCPPorts = [
1883 # MQTT server
];
2023-04-17 21:22:04 +01:00
};
2022-10-22 22:18:32 +01:00
}