refactor: centrally manage the network configuration of all hosts in homelab

feat: new host - tailscalw-gw
This commit is contained in:
Ryan Yin
2024-01-28 13:39:06 +08:00
parent 3eec2a1837
commit ad861dcc59
23 changed files with 295 additions and 243 deletions
+10 -15
View File
@@ -4,7 +4,11 @@
# Yukina - NixOS configuration for Lichee Pi 4A
#
#############################################################
{
let
hostName = "yukina"; # Define your hostname.
vars = import ../vars.nix;
hostAddress = vars.networking.hostAddress.${hostName};
in {
imports = [
# import the licheepi4a module, which contains the configuration for bootloader/kernel/firmware
(nixos-licheepi4a + "/modules/licheepi4a.nix")
@@ -14,7 +18,9 @@
# Set static IP address / gateway / DNS servers.
networking = {
hostName = "yukina"; # Define your hostname.
inherit hostName;
inherit (vars.networking) defaultGateway nameservers;
wireless = {
# https://wiki.archlinux.org/title/wpa_supplicant
enable = true;
@@ -33,12 +39,6 @@
# firewall-start[2300]: iptables: Failed to initialize nft: Protocol not supported
firewall.enable = false;
defaultGateway = "192.168.5.201";
nameservers = [
"119.29.29.29" # DNSPod
"223.5.5.5" # AliDNS
];
# Configure network proxy if necessary
# proxy.default = "http://user:password@proxy:port/";
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
@@ -46,19 +46,14 @@
# LPI4A's wireless interface
interfaces.wlan0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.5.105";
prefixLength = 24;
}
];
ipv4.addresses = [hostAddress];
};
# LPI4A's first ethernet interface
# interfaces.end0 = {
# useDHCP = false;
# ipv4.addresses = [
# {
# address = "192.168.5.105";
# address = "192.168.5.104";
# prefixLength = 24;
# }
# ];