{ config, lib, ... }: let cfg = import /etc/nixos/modules/vars.nix; name = "calibre-web-automated"; #dbport = cfg.XXX.dbport; #db_host = cfg.podman.hostIP; port = cfg.calibre.port; #domain = cfg.XXX.domain; in { imports = [ #./podman.nix #./podman-postgresql.nix # for the database #./nginx.nix # for the webserver ]; #sops.secrets."${name}/db" = {}; sops.secrets."calibre/env" = {}; #services.podman-postgresql."${name}" = { # enable = true; # image = "docker.io/library/postgres:16-alpine"; # port = (lib.strings.toInt dbport); # passwordFile = config.sops.secrets."${name}/db".path; #}; virtualisation.oci-containers.containers."${name}" = { image = "docker.io/crocodilestick/calibre-web-automated"; environment = { TZ = "Europe/Berlin"; PUID = toString config.users.users.arr.uid; PGID = toString config.users.groups.arr.gid; }; #environmentFiles = [ config.sops.secrets."calibre/env".path ]; ports = [ "${port}:${port}" ]; volumes = [ "/var/lib/${name}:/config" "/mnt/cache/calibre:/cwa-book-ingest" "/mnt/mergerfs/media/calibre:/calibre-library" ]; extraOptions = cfg.podman.extraOptions; }; virtualisation.oci-containers.containers.calibre-book-downloader = { image = "ghcr.io/calibrain/calibre-web-automated-book-downloader"; environment = { TZ = "Europe/Berlin"; UID = toString config.users.users.arr.uid; GID = toString config.users.groups.arr.gid; FLASK_PORT = "8084"; APP_ENV = "prod"; SUPPORTED_FORMATS = "pdf,epub,mobi,azw3,fb2,djvu,cbz,cbr"; }; #environmentFiles = [ config.sops.secrets."calibre/env".path ]; ports = [ "8084:8084" ]; volumes = [ #"/var/lib/${name}:/config" "/mnt/cache/calibre:/cwa-book-ingest" #"/mnt/mergerfs/media/calibre:/calibre-library" ]; extraOptions = cfg.podman.extraOptions; }; #services.nginx.virtualHosts.${domain} = { # forceSSL = true; # enableACME = true; # locations."/" = { # proxyPass = "http://localhost:${port}"; # proxyWebsockets = true; # }; # extraConfig = '' # access_log /var/log/nginx/${domain}_access.log; # error_log /var/log/nginx/${domain}_error.log; # ''; #}; } # vim: set et ts=2 sw=2 ai: