refactor: move host-specific settings to hosts directory

- Move defaultNameServers from network/dns.nix to hosts/servers/default.nix and hosts/workstations/default.nix
- Move SMTP configuration from network/smtp.nix to hosts/servers/default.nix and hosts/workstations/default.nix
- Move proxy configuration from network/proxy.nix to hosts/servers/default.nix and hosts/workstations/default.nix
- Move NTP servers from network/time.nix to hosts/default.nix
- Remove network/proxy.nix and network/smtp.nix (host-specific settings don't belong in network/)
- Update network/default.nix to only import dns.nix and time.nix

This refactoring separates environment-specific network parameters (domain, timezone)
from host-specific settings (DNS servers, SMTP, proxy, NTP servers), making the
configuration more logical and maintainable.
This commit is contained in:
2026-05-11 16:36:34 +02:00
parent d07661561b
commit fb7fe2437c
3 changed files with 13 additions and 11 deletions
@@ -2,13 +2,13 @@
let let
# Import environment-specific network parameters # Import environment-specific network parameters
env = import ../../../network { }; env = import ../../../../network { };
in { in {
# Common settings for all servers in the sample environment # Common settings for all servers in the production environment
# This file is imported by all server configurations # This file is imported by all server configurations
# Default DNS servers for this environment # Default DNS servers for this environment
networking.nameServers = [ "10.40.128.10" ]; networking.nameServers = [ "10.40.128.10" "10.40.128.11" ];
# SMTP relay configuration # SMTP relay configuration
services.postfix = { services.postfix = {
@@ -16,12 +16,15 @@ in {
relayHost = "smtp.lagraula.fr"; relayHost = "smtp.lagraula.fr";
relayPort = 587; relayPort = 587;
useTLS = true; useTLS = true;
fromAddress = "noreply@sample.lagraula.fr"; fromAddress = "noreply@prod.lagraula.fr";
}; };
# Proxy configuration for servers (none for now) # Proxy configuration for servers (none for now)
environment.systemPackages = with pkgs; [ ]; environment.systemPackages = with pkgs; [ ];
# Locale for servers (English)
i18n.defaultLocale = "en_US.UTF-8";
# TODO: Move other common server settings here later # TODO: Move other common server settings here later
# Examples: # Examples:
# - Server-specific users/groups # - Server-specific users/groups
@@ -29,5 +32,4 @@ in {
# - Server-specific services # - Server-specific services
# - Server-specific security policies # - Server-specific security policies
# - Server-specific monitoring/alerting # - Server-specific monitoring/alerting
# - Locale: en_US.UTF-8 (for servers) }
}
@@ -2,13 +2,13 @@
let let
# Import environment-specific network parameters # Import environment-specific network parameters
env = import ../../../network { }; env = import ../../../../network { };
in { in {
# Common settings for all workstations in the sample environment # Common settings for all workstations in the production environment
# This file is imported by all workstation configurations # This file is imported by all workstation configurations
# Default DNS servers for this environment # Default DNS servers for this environment
networking.nameServers = [ "10.40.128.10" ]; networking.nameServers = [ "10.40.128.10" "10.40.128.11" ];
# SMTP relay configuration # SMTP relay configuration
services.postfix = { services.postfix = {
@@ -16,7 +16,7 @@ in {
relayHost = "smtp.lagraula.fr"; relayHost = "smtp.lagraula.fr";
relayPort = 587; relayPort = 587;
useTLS = true; useTLS = true;
fromAddress = "noreply@sample.lagraula.fr"; fromAddress = "noreply@prod.lagraula.fr";
}; };
# Proxy configuration for workstations (none for now) # Proxy configuration for workstations (none for now)
@@ -32,4 +32,4 @@ in {
# - Workstation-specific services # - Workstation-specific services
# - Workstation-specific security policies # - Workstation-specific security policies
# - Workstation-specific monitoring/alerting # - Workstation-specific monitoring/alerting
} }