2023-03-07 22:33:01 +01:00
|
|
|
# This is not part of Liminix per se. This is a "scratchpad"
|
|
|
|
# configuration for a device I'm testing with.
|
|
|
|
#
|
|
|
|
# Parts of it do do things that Liminix eventually needs to do, but
|
|
|
|
# don't look in here for solutions - just for identifying the
|
|
|
|
# problems.
|
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
2024-03-17 20:03:44 +01:00
|
|
|
modulesPath,
|
2023-03-07 22:33:01 +01:00
|
|
|
...
|
|
|
|
}: let
|
2023-03-08 21:37:08 +01:00
|
|
|
secrets = import ./extneder-secrets.nix;
|
2023-03-07 22:33:01 +01:00
|
|
|
in rec {
|
|
|
|
boot = {
|
|
|
|
tftp = {
|
|
|
|
serverip = "192.168.8.148";
|
|
|
|
ipaddr = "192.168.8.251";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
imports = [
|
2024-03-17 20:03:44 +01:00
|
|
|
"${modulesPath}/profiles/wap.nix"
|
|
|
|
"${modulesPath}/vlan"
|
2023-03-07 22:33:01 +01:00
|
|
|
];
|
|
|
|
|
2023-03-08 23:11:59 +01:00
|
|
|
hostname = "extneder";
|
|
|
|
|
2023-03-07 22:33:01 +01:00
|
|
|
kernel = {
|
|
|
|
config = {
|
|
|
|
|
|
|
|
NETFILTER_XT_MATCH_CONNTRACK = "y";
|
|
|
|
|
|
|
|
IP6_NF_IPTABLES = "y"; # do we still need these
|
|
|
|
IP_NF_IPTABLES = "y"; # if using nftables directly
|
|
|
|
|
2023-09-01 18:34:47 +02:00
|
|
|
# these are copied from rotuer and need review.
|
|
|
|
# we're not running a firewall, so why do we need
|
|
|
|
# nftables config?
|
2023-03-07 22:33:01 +01:00
|
|
|
IP_NF_NAT = "y";
|
|
|
|
IP_NF_TARGET_MASQUERADE = "y";
|
|
|
|
NETFILTER = "y";
|
|
|
|
NETFILTER_ADVANCED = "y";
|
|
|
|
NETFILTER_XTABLES = "y";
|
|
|
|
|
|
|
|
NFT_COMPAT = "y";
|
|
|
|
NFT_CT = "y";
|
|
|
|
NFT_LOG = "y";
|
|
|
|
NFT_MASQ = "y";
|
|
|
|
NFT_NAT = "y";
|
|
|
|
NFT_REJECT = "y";
|
|
|
|
NFT_REJECT_INET = "y";
|
|
|
|
|
|
|
|
NF_CONNTRACK = "y";
|
|
|
|
NF_NAT = "y";
|
|
|
|
NF_NAT_MASQUERADE = "y";
|
|
|
|
NF_TABLES = "y";
|
|
|
|
NF_TABLES_INET = "y";
|
|
|
|
NF_TABLES_IPV4 = "y";
|
|
|
|
NF_TABLES_IPV6 = "y";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-27 23:39:07 +01:00
|
|
|
profile.wap = {
|
|
|
|
interfaces = with config.hardware.networkInterfaces; [
|
2023-08-28 17:08:46 +02:00
|
|
|
lan
|
|
|
|
wlan
|
|
|
|
];
|
2023-03-07 22:33:01 +01:00
|
|
|
|
2024-02-27 23:39:07 +01:00
|
|
|
wireless = {
|
|
|
|
networks.${secrets.ssid} = {
|
|
|
|
interface = config.hardware.networkInterfaces.wlan;
|
|
|
|
inherit (secrets) channel wpa_passphrase;
|
|
|
|
country_code = "GB";
|
|
|
|
hw_mode = "g";
|
|
|
|
wmm_enabled = 1;
|
|
|
|
ieee80211n = 1;
|
|
|
|
};
|
2023-03-07 22:33:01 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-11 10:10:03 +01:00
|
|
|
users.root.passwd = lib.mkForce secrets.root.passwd;
|
2023-03-07 22:33:01 +01:00
|
|
|
defaultProfile.packages = with pkgs; [nftables strace tcpdump swconfig];
|
|
|
|
}
|