nixos-config/modules/calibre-web.nix

59 lines
1.4 KiB
Nix
Raw Normal View History

2024-05-06 16:57:23 +02:00
{ config, lib, ... }:
let
cfg = import ./vars.nix;
name = "calibre";
#dbport = cfg.XXX.dbport;
#db_host = cfg.podman.hostIP;
port = cfg.calibre.port;
domain = cfg.calibre.domain;
in
{
imports = [
#./podman.nix
#./podman-postgresql.nix # for the database
./nginx.nix # for the webserver
];
#sops.secrets."${name}/db" = {};
#sops.secrets."${name}/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 = "lscr.io/linuxserver/calibre-web";
environment = {
TZ = "Europe/Berlin";
DOCKER_MODS = "linuxserver/mods:universal-calibre";
};
#environmentFiles = [ config.sops.secrets."${name}/env".path ];
ports = [
"${port}:${port}"
];
volumes = [
"/var/lib/calibre:/config"
"/mnt/mergerfs/media/books:/books"
];
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: