Add a homepage module that generates a static landing page served on port 80 via nginx. Each service module registers itself via the shared mod.homepage.services option, so enabling a module automatically adds it to the page.
41 lines
729 B
Nix
41 lines
729 B
Nix
{ lib, config, ... }:
|
|
let
|
|
enabled = config.mod.calibre-web.enable;
|
|
in
|
|
{
|
|
options = {
|
|
mod.calibre-web = {
|
|
enable = lib.mkEnableOption "add calibre-web module";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf enabled {
|
|
mod.homepage.services = [{
|
|
name = "Calibre-Web";
|
|
port = 8083;
|
|
description = "E-book library";
|
|
}];
|
|
|
|
services = {
|
|
calibre-web = {
|
|
enable = true;
|
|
|
|
user = "storage";
|
|
group = "storage";
|
|
|
|
listen = {
|
|
ip = "0.0.0.0";
|
|
port = 8083;
|
|
};
|
|
|
|
dataDir = "/mnt/media/public/books";
|
|
|
|
options = {
|
|
calibreLibrary = "/mnt/media/public/books";
|
|
enableBookUploading = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|