From 2c7366b601f16192a470b1200ddb4612204fd283 Mon Sep 17 00:00:00 2001 From: Chris Toph Date: Wed, 2 Apr 2025 01:49:59 -0400 Subject: [PATCH] Refactor networking configuration: - Move settings to a separate file - Define PVE hosts to make suse the DNS stops fucking up the SSHFS mounts --- hosts/common/core/default.nix | 13 +------------ hosts/common/core/networking.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 hosts/common/core/networking.nix diff --git a/hosts/common/core/default.nix b/hosts/common/core/default.nix index 0807c90..dc248e5 100644 --- a/hosts/common/core/default.nix +++ b/hosts/common/core/default.nix @@ -13,25 +13,14 @@ in { imports = lib.flatten [ inputs.home-manager.nixosModules.home-manager + (lib.custom.scanPaths ./.) (map lib.custom.relativeToRoot [ "modules/common" - "hosts/common/core/fonts.nix" - "hosts/common/core/ssh.nix" "hosts/users" ]) ]; - ## NETWORKING ## - networking = { - dhcpcd.enable = false; - hostName = hostSpec.hostName; - networkmanager.enable = true; - useDHCP = lib.mkDefault true; - useHostResolvConf = false; - usePredictableInterfaceNames = true; - }; - # System-wide packages, in case we log in as root environment.systemPackages = with pkgs; [ micro diff --git a/hosts/common/core/networking.nix b/hosts/common/core/networking.nix new file mode 100644 index 0000000..7d791f6 --- /dev/null +++ b/hosts/common/core/networking.nix @@ -0,0 +1,28 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + ## NETWORKING ## + networking = { + dhcpcd.enable = false; + hostName = config.hostSpec.hostName; + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + useHostResolvConf = false; + usePredictableInterfaceNames = true; + + hosts = { + "104.40.3.1" = [ "opn" ]; + "104.40.3.3" = [ "pve" ]; + "104.40.3.24" = [ "cloud" ]; + "104.40.3.34" = [ "proxy" ]; + "104.40.3.44" = [ "komodo" ]; + "104.40.3.54" = [ "nix" ]; + "104.40.4.1" = [ "opn" ]; + "104.40.4.7" = [ "rune" ]; + }; + }; +}