From e4ab80df8fc35881e8360ee0289e32cdfe9646d4 Mon Sep 17 00:00:00 2001 From: notohh Date: Sun, 2 Apr 2023 09:12:41 -0400 Subject: [PATCH] feat: move networking to modules --- hosts/hime/default.nix | 14 ++++---------- hosts/sutakku/default.nix | 13 ++++--------- hosts/tsuki/default.nix | 10 ---------- modules/default.nix | 1 + modules/networking.nix | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 29 deletions(-) create mode 100644 modules/networking.nix diff --git a/hosts/hime/default.nix b/hosts/hime/default.nix index 767a00e..0163fa2 100644 --- a/hosts/hime/default.nix +++ b/hosts/hime/default.nix @@ -1,5 +1,4 @@ { - config, pkgs, ... }: { @@ -17,6 +16,10 @@ useOSProber = false; }; }; + + networking = { + hostName = "hime"; + }; time.timeZone = "America/New_York"; @@ -73,15 +76,6 @@ nfs-utils ]; - networking = { - hostName = "hime"; - networkmanager.enable = true; - firewall ={ - enable = true; - }; - nameservers = [ "192.168.1.86" ]; - }; - nix = { package = pkgs.nixFlakes; extraOptions = '' diff --git a/hosts/sutakku/default.nix b/hosts/sutakku/default.nix index 5ed07ea..cffc670 100644 --- a/hosts/sutakku/default.nix +++ b/hosts/sutakku/default.nix @@ -16,6 +16,10 @@ }; }; + networking = { + hostName = "sutakku"; + }; + time.timeZone = "America/New_York"; i18n.defaultLocale = "en_US.UTF-8"; @@ -62,15 +66,6 @@ services.openssh.enable = true; - networking = { - hostName = "sutakku"; - networkmanager.enable = true; - firewall = { - enable = true; - }; - nameservers = [ "192.168.1.86" ]; - }; - nix = { package = pkgs.nixFlakes; extraOptions = '' diff --git a/hosts/tsuki/default.nix b/hosts/tsuki/default.nix index cc08e04..fa95cea 100755 --- a/hosts/tsuki/default.nix +++ b/hosts/tsuki/default.nix @@ -30,17 +30,7 @@ virtualisation.libvirtd.enable = true; networking = { - networkmanager.enable = true; - nameservers = [ "192.168.1.86" ]; hostName = "tsuki"; - firewall = { - enable = true; - }; - }; - - # pihole - environment.etc = { - "resolv.conf".text = "nameserver 192.168.1.86\n"; }; time.timeZone = "America/New_York"; diff --git a/modules/default.nix b/modules/default.nix index 6cf8017..010dd84 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,5 +5,6 @@ ./tailscale.nix ./security.nix ./udevd.nix + ./networking.nix ]; } diff --git a/modules/networking.nix b/modules/networking.nix new file mode 100644 index 0000000..10fd87c --- /dev/null +++ b/modules/networking.nix @@ -0,0 +1,14 @@ +{ + ... +}: { + networking = { + networkmanager.enable = true; + nameservers = [ "192.168.1.86" ]; + firewall = { + enable = true; + }; + }; + environment.etc = { + "resolv.conf".text = "nameserver 192.168.1.86\n"; + }; +} \ No newline at end of file