books
This commit is contained in:
46
modules/nixos/services/booklore/default.nix
Normal file
46
modules/nixos/services/booklore/default.nix
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
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 ];
|
||||||
|
}
|
||||||
|
- ./data:/app/data
|
||||||
|
- ./books:/books
|
||||||
|
- ./bookdrop:/bookdrop
|
||||||
@@ -43,6 +43,10 @@ in
|
|||||||
port = 4822;
|
port = 4822;
|
||||||
# environmentFile = "/run/secrets/jallen-nas/authentik-env"; # TODO
|
# environmentFile = "/run/secrets/jallen-nas/authentik-env"; # TODO
|
||||||
};
|
};
|
||||||
|
booklore = {
|
||||||
|
enable = true;
|
||||||
|
port = 6060;
|
||||||
|
};
|
||||||
caddy = disabled;
|
caddy = disabled;
|
||||||
calibre = {
|
calibre = {
|
||||||
enable = false;
|
enable = false;
|
||||||
|
|||||||
@@ -91,7 +91,9 @@
|
|||||||
port = 3306;
|
port = 3306;
|
||||||
};
|
};
|
||||||
initialDatabases = [
|
initialDatabases = [
|
||||||
"booklore"
|
{
|
||||||
|
name = "booklore";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user