Add a homepage module that generates a static landing page served on port 9999 via nginx. Each service module registers itself via the shared mod.homepage.services option, so enabling a module automatically adds it to the page.
36 lines
663 B
Nix
36 lines
663 B
Nix
{ lib, config, ... }:
|
|
let
|
|
enabled = config.mod.audiobookshelf.enable;
|
|
in
|
|
{
|
|
options = {
|
|
mod.audiobookshelf = {
|
|
enable = lib.mkEnableOption "Enable audiobookshelf module";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf enabled {
|
|
mod.homepage.services = [{
|
|
name = "Audiobookshelf";
|
|
port = 8000;
|
|
description = "Audiobooks & podcasts";
|
|
}];
|
|
|
|
users.users.audiobookshelf = {
|
|
isSystemUser = true;
|
|
description = "audiobookshelf";
|
|
group = "storage";
|
|
};
|
|
|
|
services.audiobookshelf = {
|
|
enable = true;
|
|
|
|
user = "audiobookshelf";
|
|
group = "storage";
|
|
|
|
host = "0.0.0.0";
|
|
port = 8000;
|
|
};
|
|
};
|
|
}
|