aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-14 15:23:41 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-14 15:23:43 +0530
commit58519ea7b12e8ad58c0f97d9636d30572a789b41 (patch)
treea7b8f8607904c94d0dafd5067e07591623abc3aa
parent3ca2ed77934e9df990ace36836b05acd8372d0cb (diff)
downloadhomeserver-nixos-config-58519ea7b12e8ad58c0f97d9636d30572a789b41.tar.gz
homeserver-nixos-config-58519ea7b12e8ad58c0f97d9636d30572a789b41.zip
Refactor network module
-rw-r--r--configuration.nix3
-rw-r--r--modules/network/default.nix25
-rw-r--r--modules/network/wireless.nix28
3 files changed, 30 insertions, 26 deletions
diff --git a/configuration.nix b/configuration.nix
index af520fb..f1af667 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -11,8 +11,6 @@
./modules/monitoring
];
- nixpkgs.config.allowUnfree = true;
-
environment.systemPackages = with pkgs; [
bottom
mtm
@@ -42,6 +40,7 @@
automatic = true;
dates = "weekly";
};
+ nixpkgs.config.allowUnfree = true;
system.stateVersion = "25.05";
}
diff --git a/modules/network/default.nix b/modules/network/default.nix
index 8061850..290c291 100644
--- a/modules/network/default.nix
+++ b/modules/network/default.nix
@@ -6,6 +6,7 @@ let
in
{
imports = [
+ ./wireless.nix
./ssh.nix
./service-router.service.nix
];
@@ -28,30 +29,6 @@ in
networking = {
hostName = "bacchus";
-
firewall.enable = true;
-
- networkmanager = {
- enable = true;
- # wifi.powersave = true;
- ensureProfiles.profiles = {
- home-wifi = {
- connection = {
- id = "home-wifi";
- type = "wifi";
- autoconnect = true;
- };
- wifi = {
- mode = "infrastructure";
- ssid = settings.network.wireless.ssid;
- };
- wifi-security = {
- auth-alg = "open";
- key-mgmt = "wpa-psk";
- psk = settings.network.wireless.password;
- };
- };
- };
- };
};
}
diff --git a/modules/network/wireless.nix b/modules/network/wireless.nix
new file mode 100644
index 0000000..82c8b55
--- /dev/null
+++ b/modules/network/wireless.nix
@@ -0,0 +1,28 @@
+{ lib, ... }:
+let
+ settings = import ../../settings.nix { inherit lib; };
+ wireless = settings.network.wireless;
+in
+{
+ networking.networkmanager = {
+ enable = true;
+ ensureProfiles.profiles = {
+ home-wifi = {
+ connection = {
+ id = "home-wifi";
+ type = "wifi";
+ autoconnect = true;
+ };
+ wifi = {
+ mode = "infrastructure";
+ ssid = wireless.ssid;
+ };
+ wifi-security = {
+ auth-alg = "open";
+ key-mgmt = "wpa-psk";
+ psk = wireless.password;
+ };
+ };
+ };
+ };
+}