cleanup
This commit is contained in:
@@ -4,40 +4,27 @@
|
||||
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://10.0.1.3:3306/booklore";
|
||||
DATABASE_USERNAME = "booklore";
|
||||
DATABASE_PASSWORD = "Lucifer008!";
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
cfg = config.${namespace}.services.booklore;
|
||||
in
|
||||
{
|
||||
imports = [ bookloreConfig ];
|
||||
imports = [
|
||||
(lib.${namespace}.mkContainerService {
|
||||
inherit config;
|
||||
name = "booklore";
|
||||
image = "booklore/booklore";
|
||||
internalPort = 6060;
|
||||
volumes = [
|
||||
"${cfg.configDir}/booklore:/app/data"
|
||||
"${cfg.configDir}/bookdrop:/bookdrop"
|
||||
"${cfg.dataDir}/books:/books"
|
||||
];
|
||||
environment = {
|
||||
DATABASE_URL = "jdbc:mariadb://10.0.1.3:3306/booklore";
|
||||
DATABASE_USERNAME = "booklore";
|
||||
# TODO: move DATABASE_PASSWORD to a sops secret
|
||||
DATABASE_PASSWORD = "Lucifer008!";
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user