2024-06-14 02:58:39 +03:00
|
|
|
{ container, lib, pkgs, ... } @args: let
|
2024-06-09 23:35:53 +03:00
|
|
|
cfg = container.config.read;
|
|
|
|
in {
|
|
|
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
|
|
|
"data"
|
|
|
|
];
|
|
|
|
|
|
|
|
containers.read = container.mkContainer cfg {
|
|
|
|
bindMounts = {
|
|
|
|
"/var/lib/kavita" = {
|
|
|
|
hostPath = "${cfg.storage}/data";
|
|
|
|
isReadOnly = false;
|
|
|
|
};
|
2024-06-13 17:00:05 +03:00
|
|
|
}
|
|
|
|
// container.attachMedia "book" cfg.book true
|
|
|
|
// container.attachMedia "manga" cfg.manga true
|
|
|
|
;
|
2024-06-09 23:35:53 +03:00
|
|
|
|
2024-06-14 02:58:39 +03:00
|
|
|
config = { ... }: container.mkContainerConfig cfg {
|
2024-06-09 23:35:53 +03:00
|
|
|
services.kavita = {
|
|
|
|
enable = true;
|
|
|
|
dataDir = "/var/lib/kavita";
|
|
|
|
tokenKeyFile = pkgs.writeText "KavitaToken" "xY19aQOa939/Ie6GCRGbubVK8zRwrgBY/20AuyMpYshUjwK1Uyl7bw1yknVh6jJIFIfwq2vAjeotOUq7NEsf9Q==";
|
|
|
|
settings = {
|
|
|
|
IpAddresses = cfg.address;
|
|
|
|
Port = cfg.port;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|