configuration.nix (1444B)
1 { config, pkgs, ... }: 2 let 3 # EDIT: you can pick your preferred RFC1918 address space 4 # for NATted connections, if you don't like this one. 5 ipv4LocalNet = "10.8.0"; 6 svc = config.system.service; 7 8 in 9 rec { 10 imports = [ 11 ../../modules/bridge 12 ../../modules/dhcp6c 13 ../../modules/dnsmasq 14 ../../modules/firewall 15 ../../modules/hostapd 16 ../../modules/network 17 ../../modules/ssh 18 ../../modules/vlan 19 ../../modules/wlan.nix 20 ]; 21 rootfsType = "jffs2"; 22 hostname = "updown"; 23 24 services.int = svc.network.address.build { 25 interface = svc.bridge.primary.build { ifname = "int"; }; 26 family = "inet"; 27 address = "${ipv4LocalNet}.1"; 28 prefixLength = 16; 29 }; 30 31 services.bridge = svc.bridge.members.build { 32 primary = services.int; 33 members = with config.hardware.networkInterfaces; [ lan ]; 34 }; 35 36 services.sshd = svc.ssh.build { }; 37 38 # users.root = { 39 # # EDIT: choose a root password and then use 40 # # "mkpasswd -m sha512crypt" to determine the hash. 41 # # It should start wirh $6$. 42 # passwd = "$6$6HG7WALLQQY1LQDE$428cnouMJ7wVmyK9.dF1uWs7t0z9ztgp3MHvN5bbeo0M4Kqg/u2ThjoSHIjCEJQlnVpDOaEKcOjXAlIClHWN21"; 43 # openssh.authorizedKeys.keys = [ 44 # # EDIT: you can add your ssh pubkey here 45 # # "ssh-rsa AAAAB3NzaC1....H6hKd user@example.com"; 46 # ]; 47 # }; 48 49 defaultProfile.packages = with pkgs; [ 50 min-collect-garbage 51 # strace 52 # ethtool 53 tcpdump 54 ]; 55 }