refactor: Move network configurations to machine directories

- Move network-congenital-optimist.nix to machines/congenital-optimist/
- Move network-sleeper-service.nix to machines/sleeper-service/
- Update import paths in machine configurations
- Clean up modules/network/common.nix to remove SSH duplication
- Consolidate SSH configuration in modules/security/ssh-keys.nix
- Remove machine-specific networking from shared common module

This improves dependency tracking by co-locating machine-specific
network configurations with their respective machines.
This commit is contained in:
Geir Okkenhaug Jerstad 2025-06-06 18:08:45 +02:00
parent fff47629f2
commit e976b14d19
6 changed files with 12 additions and 17 deletions

View file

@ -7,7 +7,7 @@
}: { }: {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/network/network-congenital-optimist.nix ./network-congenital-optimist.nix
# Security modules # Security modules
../../modules/security/ssh-keys.nix ../../modules/security/ssh-keys.nix

View file

@ -4,7 +4,7 @@
{ {
imports = [ imports = [
./common.nix ../../modules/network/common.nix
]; ];
# Machine-specific network configuration # Machine-specific network configuration

View file

@ -4,9 +4,9 @@
# Security modules # Security modules
../../modules/security/ssh-keys.nix ../../modules/security/ssh-keys.nix
# Network configuration # Network configuration
../../modules/network/network-sleeper-service.nix ./network-sleeper-service.nix
# Services # Services
../../modules/services/nfs.nix ./nfs.nix
../../modules/system/transmission.nix ../../modules/system/transmission.nix
# User modules - server only needs sma user # User modules - server only needs sma user

View file

@ -4,7 +4,7 @@
{ {
imports = [ imports = [
./common.nix ../../modules/network/common.nix
]; ];
# Machine-specific network configuration # Machine-specific network configuration

View file

@ -1,5 +1,5 @@
# Common Network Configuration # Common Network Configuration
# Shared networking settings across all machines # Minimal shared networking settings across all machines
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
@ -8,11 +8,10 @@
# Enable nftables by default for all machines # Enable nftables by default for all machines
nftables.enable = true; nftables.enable = true;
# Common firewall settings # Basic firewall settings (SSH handled by security/ssh-keys.nix)
firewall = { firewall = {
enable = true; enable = true;
# SSH is allowed by default on all machines # SSH port is configured in modules/security/ssh-keys.nix
allowedTCPPorts = [ 22 ];
}; };
}; };
@ -21,13 +20,6 @@
# Tailscale VPN for secure remote access # Tailscale VPN for secure remote access
tailscale.enable = true; tailscale.enable = true;
# SSH access with secure defaults # Note: SSH configuration is handled by modules/security/ssh-keys.nix
openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
}; };
} }

View file

@ -3,6 +3,9 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
# Firewall configuration for SSH
networking.firewall.allowedTCPPorts = [ 22 ];
# Global SSH daemon configuration # Global SSH daemon configuration
services.openssh = { services.openssh = {
enable = true; enable = true;