44 lines
992 B
Nix
44 lines
992 B
Nix
{
|
|
lib,
|
|
config,
|
|
namespace,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
name = "booklore";
|
|
cfg = config.${namespace}.services.${name};
|
|
|
|
bookloreConfig = lib.${namespace}.mkModule {
|
|
inherit config name;
|
|
serviceName = "podman-${name}";
|
|
description = "booklore";
|
|
options = { };
|
|
moduleConfig = {
|
|
virtualisation.oci-containers.containers.${name} = {
|
|
autoStart = true;
|
|
image = "booklore/booklore";
|
|
volumes = [
|
|
"${cfg.configDir}/booklore:/app/data"
|
|
"${cfg.configDir}/bookdrop:/bookdrop"
|
|
"${cfg.dataDir}/books:/books"
|
|
];
|
|
ports = [
|
|
"${toString cfg.port}:6060"
|
|
];
|
|
environment = {
|
|
DATABASE_URL = "jdbc:mariadb://localhost:3306/booklore";
|
|
DATABASE_USERNAME = "booklore";
|
|
# DATABASE_PASSWORD = ${DB_PASSWORD};
|
|
PUID = cfg.puid;
|
|
PGID = cfg.pgid;
|
|
TZ = cfg.timeZone;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
imports = [ bookloreConfig ];
|
|
}
|