aboutsummaryrefslogtreecommitdiff
path: root/modules/network
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-08 17:11:30 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-10 16:18:26 +0530
commit969a9a311d24548c6632ddcdc4f903ffa48c5ca6 (patch)
tree9e508610c3e077647cc39ceb398a8226be8c21d0 /modules/network
parent93179e7a79ca08464b9e443df41383b487bda7e8 (diff)
downloadhomeserver-nixos-config-969a9a311d24548c6632ddcdc4f903ffa48c5ca6.tar.gz
homeserver-nixos-config-969a9a311d24548c6632ddcdc4f903ffa48c5ca6.zip
Init commit with shit that does it
Diffstat (limited to '')
-rw-r--r--modules/network/default.nix37
-rw-r--r--modules/network/ssh.nix11
2 files changed, 48 insertions, 0 deletions
diff --git a/modules/network/default.nix b/modules/network/default.nix
new file mode 100644
index 0000000..444f53c
--- /dev/null
+++ b/modules/network/default.nix
@@ -0,0 +1,37 @@
+{ ... }:
+let
+ private = import ../../config.private.nix;
+in {
+ imports = [ ./ssh.nix ];
+
+ 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 = private.wireless.ssid;
+ };
+ wifi-security = {
+ auth-alg = "open";
+ key-mgmt = "wpa-psk";
+ psk = private.wireless.password;
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/modules/network/ssh.nix b/modules/network/ssh.nix
new file mode 100644
index 0000000..e4e5b2a
--- /dev/null
+++ b/modules/network/ssh.nix
@@ -0,0 +1,11 @@
+{ lib, ... }:
+let
+ private = import ../../config.private.nix;
+in {
+ services.sshd.enable = true;
+
+ # Auth
+ # TODO: dont allow via password
+ # openssh.authorizedKeys.keys = private.ssh.authorizedKeys;
+ services.openssh.settings.PermitRootLogin = "yes";
+}