nixcfg/nixosModules/containers/oci/audiobookshelf/default.nix

33 lines
1.1 KiB
Nix
Raw Normal View History

{
pkgs,
lib,
config,
...
}: {
options = {
alyraffauf.containers.oci.audiobookshelf.enable =
lib.mkEnableOption "Enable audiobookshelf podcast and audiobook server.";
alyraffauf.containers.oci.audiobookshelf.mediaDirectory = lib.mkOption {
description = "Media directory for audiobookshelf.";
default = "/mnt/Media";
type = lib.types.str;
};
2024-04-22 21:49:08 -04:00
alyraffauf.containers.oci.audiobookshelf.port = lib.mkOption {
description = "Port for audiobookshelf.";
default = 13378;
type = lib.types.int;
};
};
config = lib.mkIf config.alyraffauf.containers.oci.audiobookshelf.enable {
virtualisation.oci-containers.containers = {
audiobookshelf = {
2024-04-22 21:49:08 -04:00
ports = ["0.0.0.0:${toString config.alyraffauf.containers.oci.audiobookshelf.port}:80"];
image = "ghcr.io/advplyr/audiobookshelf:latest";
environment = {TZ = "America/New_York";};
volumes = ["abs_config:/config" "abs_metadata:/metadata" "${config.alyraffauf.containers.oci.audiobookshelf.mediaDirectory}:/Media"];
};
};
};
}