36 lines
829 B
Nix
36 lines
829 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
net = import ../data/network.nix;
|
|
service_data = import ../data/services.nix;
|
|
kiwix = service_data.kiwix;
|
|
in {
|
|
systemd.tmpfiles.rules = [
|
|
"d ${kiwix.root_dir} 0755 root root - -"
|
|
"d ${kiwix.root_dir}/data 0755 root root - -"
|
|
];
|
|
|
|
virtualisation.oci-containers.containers = {
|
|
kiwix-serve = {
|
|
image = "ghcr.io/kiwix/kiwix-serve:3.8.2";
|
|
ports = ["8086:8080"];
|
|
volumes = ["${kiwix.root_dir}/:/data:ro"];
|
|
cmd = [
|
|
"--monitorLibrary"
|
|
"--library" "/data/library.xml"
|
|
];
|
|
environment = {
|
|
TZ = "Europe/Berlin";
|
|
};
|
|
extraOptions = [
|
|
"--memory=512m"
|
|
"--memory-swap=512m"
|
|
"--cpus=1"
|
|
];
|
|
autoStart = true;
|
|
};
|
|
};
|
|
|
|
networking.firewall = {
|
|
allowedTCPPorts = [8086];
|
|
};
|
|
}
|