<commit_before>{ config, pkgs, ... }:
{
  imports =
    [
      ./hardware-configuration.nix
    ];
  # Use the GRUB 2 boot loader.
  boot = {
    loader.grub = {
      enable = true;
      version = 2;
      device = "/dev/sda";
    };
    binfmt.emulatedSystems = [ "aarch64-linux" ];
  };

  networking = {
    hostName = "util";
    defaultGateway = "10.25.89.1";
    nameservers = [ "10.25.89.1" ]; # todo: set to localhost?
    interfaces.eth0.ipv4.addresses = [{
      address = "10.25.89.53";
      prefixLength = 24;
    }];
  };


  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "21.11"; # Did you read the comment?

  services = {
    unifi = {
      enable = true;
      unifiPackage = pkgs.unifiStable;
    };
    nginx = {
      enable = true;
      recommendedGzipSettings = true;
      recommendedOptimisation = true;
      recommendedProxySettings = true;
      recommendedTlsSettings = true;
      # other Nginx options

      virtualHosts."unifi.apps.dmz.509ely.com" = {
        enableACME = false;
        forceSSL = true;
        sslCertificate = "/var/lib/acme/star.apps.dmz.509ely.com/cert.pem";
        sslCertificateKey = "/var/lib/acme/star.apps.dmz.509ely.com/key.pem";
        locations."/" = {
          proxyPass = "https://127.0.0.1:8443";
          extraConfig =
            "proxy_ssl_verify off;" +

            # for uploading and restoring backups
            "client_max_body_size 100M;" +
            # required when the target is also TLS server with multiple hosts
            #
            #"proxy_ssl_server_name on;" +
            # required when the server wants to use HTTP Authentication
            "proxy_pass_header Authorization;"
          ;
        };
      };
    };
  };
  security.acme = {
    certs = {
      "star.apps.dmz.509ely.com" = {
        # todo: make *
        dnsProvider = "namecheap";
        credentialsFile = config.sops.secrets.namecheap.path;
        extraDomainNames = [
          "unifi.apps.dmz.509ely.com"
        ];
      };
    };
  };
  networking.firewall = {
    allowedTCPPorts = [ 80 443 ];
  };
  users.users.nginx.extraGroups = [ "acme" ];
  sops.secrets = {
    namecheap = {
      owner = "acme";
      group = "acme";
    };
  };

  systemFoundry = {
    dnsServer = {
      enable = true;
      blacklist.enable = true;

      upstreamDnsServers = [ "10.25.89.1" ];
      # todo: why are the CNAMEs not working and I have to use A recorcs?
      aRecords = {
        "util.dmz.509ely.com" = "10.25.89.53";
        "grafana.apps.dmz.509ely.com" = "10.25.89.53";
        "jellyfin.apps.dmz.509ely.com" = "10.25.89.53";
        "nzbget.apps.dmz.509ely.com" = "10.25.89.53";
        "nzbhydra.apps.dmz.509ely.com" = "10.25.89.53";
        "radarr.apps.dmz.509ely.com" = "10.25.89.53";
        "sonarr.apps.dmz.509ely.com" = "10.25.89.53";
      };
      cnameRecords = {
        #"grafana.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"jellyfin.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"nzbget.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"nzbhydra.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"radarr.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"sonarr.apps.dmz.509ely.com" = "util.dmz.509ely.com";
      };
      domainRecords = { };
    };
  };
}
<commit_msg>chore: remove unused config<commit_after>{ config, pkgs, ... }:
{
  imports =
    [
      ./hardware-configuration.nix
    ];
  # Use the GRUB 2 boot loader.
  boot = {
    loader.grub = {
      enable = true;
      version = 2;
      device = "/dev/sda";
    };
    binfmt.emulatedSystems = [ "aarch64-linux" ];
  };

  networking = {
    hostName = "util";
    defaultGateway = "10.25.89.1";
    nameservers = [ "10.25.89.1" ]; # todo: set to localhost?
    interfaces.eth0.ipv4.addresses = [{
      address = "10.25.89.53";
      prefixLength = 24;
    }];
  };


  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "21.11"; # Did you read the comment?

  networking.firewall = {
    allowedTCPPorts = [ 80 443 ];
  };
  users.users.nginx.extraGroups = [ "acme" ];
  sops.secrets = {
    namecheap = {
      owner = "acme";
      group = "acme";
    };
  };

  systemFoundry = {
    dnsServer = {
      enable = true;
      blacklist.enable = true;

      upstreamDnsServers = [ "10.25.89.1" ];
      # todo: why are the CNAMEs not working and I have to use A recorcs?
      aRecords = {
        "util.dmz.509ely.com" = "10.25.89.53";
        "grafana.apps.dmz.509ely.com" = "10.25.89.53";
        "jellyfin.apps.dmz.509ely.com" = "10.25.89.53";
        "nzbget.apps.dmz.509ely.com" = "10.25.89.53";
        "nzbhydra.apps.dmz.509ely.com" = "10.25.89.53";
        "radarr.apps.dmz.509ely.com" = "10.25.89.53";
        "sonarr.apps.dmz.509ely.com" = "10.25.89.53";
      };
      cnameRecords = {
        #"grafana.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"jellyfin.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"nzbget.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"nzbhydra.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"radarr.apps.dmz.509ely.com" = "util.dmz.509ely.com";
        #"sonarr.apps.dmz.509ely.com" = "util.dmz.509ely.com";
      };
      domainRecords = { };
    };
  };
}

{'fraction_non_alphanumeric': 0.14834983498349835, 'fraction_numerical': 0.057095709570957096, 'mean_word_length': 2.1371635610766044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 23, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4994723', 'n_tokens_mistral': 2419, 'n_tokens_neox': 2193, 'n_words': 416}