2024-06-08 10:19:47 -04:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: {
|
2024-06-26 22:13:02 -04:00
|
|
|
config = lib.mkIf config.ar.containers.nixos.audiobookshelf.enable {
|
2024-06-08 10:19:47 -04:00
|
|
|
containers.audiobookshelf = {
|
|
|
|
autoStart = true;
|
2024-06-08 11:31:59 -04:00
|
|
|
bindMounts."/Media" = {
|
2024-06-26 22:13:02 -04:00
|
|
|
hostPath = config.ar.containers.nixos.audiobookshelf.mediaDirectory;
|
2024-06-08 11:31:59 -04:00
|
|
|
isReadOnly = false;
|
|
|
|
};
|
2024-06-08 10:19:47 -04:00
|
|
|
config = let
|
2024-06-26 22:13:02 -04:00
|
|
|
port = config.ar.containers.nixos.audiobookshelf.port;
|
2024-06-08 10:19:47 -04:00
|
|
|
in
|
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
system.stateVersion = "24.05";
|
|
|
|
services.audiobookshelf = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
host = "0.0.0.0";
|
|
|
|
port = port;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|