{ config, lib, pkgs, ... }: with lib; let site = config.fudo.site; hostname = config.networking.hostName; winnipeg-networks = [ "208.81.1.128/28" "208.81.3.112/28" "192.168.11.1/24" ]; site-configs = { global-config = { }; winnipeg = global-config // { time.timeZone = "America/Winnipeg"; fudo.common.local-networks = winnipeg-networks; services.cron = { mailto = "admin@fudo.org"; }; networking = { domain = "fudo.org"; search = ["fudo.org"]; firewall.enable = false; networkmanager.enable = pkgs.lib.mkForce false; nameservers = [ "1.1.1.1" "208.81.7.14" "2606:4700:4700::1111" ]; }; security.acme.certs."${hostname}" = { email = "admin@fudo.org"; plugins = [ "fullchain.pem" "full.pem" "key.pem" "chain.pem" "cert.pem" ]; }; fudo.node-exporter = { enable = true; hostname = hostname; }; nginx = { enable = true; recommendedGzipSettings = true; recommendedOptimisation = true; recommendedTlsSettings = true; }; }; nutty-club = winnipeg // { defaultGateway = "208.81.3.113"; }; }; in { options.fudo.site = mkOption { type = types.enum (attrNames site-configs); example = "nutty-club"; description = '' The site at which this host is located. This will do some site-dependent configuration. ''; default = ""; }; config = optionalAttrs (site-configs ? site) site-configs.${site}; }