extneder.nix (1894B)
1 # This is not part of Liminix per se. This is a "scratchpad" 2 # configuration for a device I'm testing with. 3 # 4 # Parts of it do do things that Liminix eventually needs to do, but 5 # don't look in here for solutions - just for identifying the 6 # problems. 7 { 8 config, 9 pkgs, 10 lib, 11 ... 12 }: let 13 secrets = import ./extneder-secrets.nix; 14 in rec { 15 boot = { 16 tftp = { 17 serverip = "192.168.8.148"; 18 ipaddr = "192.168.8.251"; 19 }; 20 }; 21 22 imports = [ 23 ../modules/profiles/wap.nix 24 ../modules/vlan 25 ]; 26 27 hostname = "extneder"; 28 29 kernel = { 30 config = { 31 32 NETFILTER_XT_MATCH_CONNTRACK = "y"; 33 34 IP6_NF_IPTABLES = "y"; # do we still need these 35 IP_NF_IPTABLES = "y"; # if using nftables directly 36 37 # these are copied from rotuer and need review. 38 # we're not running a firewall, so why do we need 39 # nftables config? 40 IP_NF_NAT = "y"; 41 IP_NF_TARGET_MASQUERADE = "y"; 42 NETFILTER = "y"; 43 NETFILTER_ADVANCED = "y"; 44 NETFILTER_XTABLES = "y"; 45 46 NFT_COMPAT = "y"; 47 NFT_CT = "y"; 48 NFT_LOG = "y"; 49 NFT_MASQ = "y"; 50 NFT_NAT = "y"; 51 NFT_REJECT = "y"; 52 NFT_REJECT_INET = "y"; 53 54 NF_CONNTRACK = "y"; 55 NF_NAT = "y"; 56 NF_NAT_MASQUERADE = "y"; 57 NF_TABLES = "y"; 58 NF_TABLES_INET = "y"; 59 NF_TABLES_IPV4 = "y"; 60 NF_TABLES_IPV6 = "y"; 61 }; 62 }; 63 64 profile.wap = { 65 interfaces = with config.hardware.networkInterfaces; [ 66 lan 67 wlan 68 ]; 69 70 wireless = { 71 networks.${secrets.ssid} = { 72 interface = config.hardware.networkInterfaces.wlan; 73 inherit (secrets) channel wpa_passphrase; 74 country_code = "GB"; 75 hw_mode = "g"; 76 wmm_enabled = 1; 77 ieee80211n = 1; 78 }; 79 }; 80 }; 81 82 users.root.passwd = lib.mkForce secrets.root.passwd; 83 defaultProfile.packages = with pkgs; [nftables strace tcpdump swconfig]; 84 }