infra/config/services/containers.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

2023-05-06 06:49:46 +02:00
{config, ...}: let
ghcrLogin = {
registry = "ghcr.io";
username = "nekowinston";
passwordFile = config.age.secrets."containers/ghcr-token".path;
};
websitePort = "14139";
in {
2023-07-03 03:43:57 +02:00
virtualisation = {
podman = {
enable = true;
autoPrune = {
enable = true;
dates = "03:30";
2023-05-06 06:49:46 +02:00
};
};
2023-07-03 03:43:57 +02:00
oci-containers = {
backend = "podman";
containers = {
faerber-bot = {
image = "ghcr.io/nekowinston/faerber/faerber-discord-bot:latest";
environmentFiles = [config.age.secrets."containers/faerber.env".path];
2023-11-27 08:22:24 +01:00
extraOptions = ["--pull=always"];
2023-07-03 03:43:57 +02:00
};
website = {
image = "ghcr.io/nekowinston/winston.sh/winston-sh:latest";
login = ghcrLogin;
ports = ["127.0.0.1:${websitePort}:3000"];
2023-11-27 08:22:24 +01:00
extraOptions = ["--pull=always"];
2023-07-03 03:43:57 +02:00
};
};
2023-05-06 06:49:46 +02:00
};
};
services.nginx.virtualHosts."winston.sh" = {
locations."/".proxyPass = "http://127.0.0.1:${websitePort}";
forceSSL = true;
enableACME = false;
useACMEHost = "winston.sh";
};
}