infrastructure/nixos/hosts/hades/docker-registry/configuration.nix
Vivian 2c16870d66
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
nixfmt
2023-05-04 13:08:10 +02:00

50 lines
1.2 KiB
Nix

{ config, ... }:
let vs = config.vault-secrets.secrets;
in {
system.stateVersion = "22.05";
networking.interfaces.eth0.useDHCP = true;
# the registry port and metrics port
networking.firewall.allowedTCPPorts =
[ config.services.dockerRegistry.port 5001 ];
vault-secrets.secrets.docker-registry = { };
# Sets the minio user and password
systemd.services.docker-registry.serviceConfig.EnvironmentFile =
"${vs.docker-registry}/environment";
services.dockerRegistry = {
enable = true;
enableDelete = true;
enableGarbageCollect = true;
listenAddress = "0.0.0.0";
storagePath = null; # We want to store in s3
garbageCollectDates = "weekly";
extraConfig = {
# S3 Storages
storage.s3 = {
regionendpoint = "https://o.xirion.net";
bucket = "docker-registry";
region = "us-east-1"; # Fake but needed
};
# Enable prom under :5001/metrics
http.debug.addr = "0.0.0.0:5001";
http.debug.prometheus.enabled = true;
# Webhooks
notifications.endpoints = [{
name = "keel";
url = "http://10.10.10.17:9300/v1/webhooks/registry";
timeout = "500ms";
treshold = 5;
backoff = "1s";
}];
};
};
}