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:
@@ -0,0 +1,26 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Import the LXC machine type and DNS service from the framework
|
||||
../../../../modules/machine-types/lxc
|
||||
../../../../modules/services/dns/default.nix
|
||||
];
|
||||
|
||||
# Enable LXC machine type
|
||||
lxc.enable = true;
|
||||
|
||||
# Host identity — replace with your own hostname and IP
|
||||
networking.hostName = "dns01";
|
||||
networking.useDHCP = true;
|
||||
|
||||
# DNS service configuration — adapt to your network
|
||||
services.dns = {
|
||||
enable = true;
|
||||
recursion = "AllowOnlyForPrivateNetworks";
|
||||
forwarders = [ "1.1.1.1" "8.8.8.8" ];
|
||||
listenAddresses = [ "10.0.0.10" "127.0.0.1" "::1" ];
|
||||
};
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
Reference in New Issue
Block a user