photoncloud-monorepo/nix-nos/examples/home-router.nix
centra 3eeb303dcb feat: Batch commit for T039.S3 deployment
Includes all pending changes needed for nixos-anywhere:
- fiberlb: L7 policy, rule, certificate types
- deployer: New service for cluster management
- nix-nos: Generic network modules
- Various service updates and fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 04:34:51 +09:00

41 lines
871 B
Nix

# Simple home router configuration
# Provides WAN DHCP connection and LAN with NAT
{ config, pkgs, ... }:
{
imports = [ ../modules ];
# Enable Nix-NOS
nix-nos.enable = true;
# WAN interface - DHCP from ISP
nix-nos.interfaces.wan = {
dhcp = true;
};
# LAN interface - Static IP for local network
nix-nos.interfaces.lan = {
addresses = [ "192.168.1.1/24" ];
};
# Enable IP forwarding for routing
nix-nos.network.enableIpForwarding = true;
# NAT configuration for internet sharing
networking.nat = {
enable = true;
externalInterface = "wan";
internalInterfaces = [ "lan" ];
};
# DHCP server for LAN clients
services.dnsmasq = {
enable = true;
settings = {
interface = "lan";
dhcp-range = [ "192.168.1.100,192.168.1.200,24h" ];
dhcp-option = [ "option:router,192.168.1.1" ];
};
};
}