containers: added native nix audiobookshelf container

This commit is contained in:
Aly Raffauf 2024-06-08 10:19:47 -04:00
parent 678f551246
commit 318eda3b4a
2 changed files with 51 additions and 1 deletions

View file

@ -0,0 +1,47 @@
{
pkgs,
lib,
config,
...
}: {
options = {
alyraffauf.containers.nixos.audiobookshelf = {
enable =
lib.mkEnableOption "Enable audiobookshelf nixos container.";
mediaDirectory = lib.mkOption {
description = "Media directory for Audiobookshelf.";
default = "/mnt/Media";
type = lib.types.str;
};
port = lib.mkOption {
description = "Port for audiobookshelf.";
default = 13378;
type = lib.types.int;
};
};
};
config = lib.mkIf config.alyraffauf.containers.nixos.audiobookshelf.enable {
containers.audiobookshelf = {
autoStart = true;
bindMounts."/Media".hostPath = config.alyraffauf.containers.nixos.audiobookshelf.mediaDirectory;
config = let
port = config.alyraffauf.containers.nixos.audiobookshelf.port;
in
{
config,
lib,
pkgs,
...
}: {
system.stateVersion = "24.05";
services.audiobookshelf = {
enable = true;
openFirewall = true;
host = "0.0.0.0";
port = port;
};
};
};
};
}

View file

@ -4,5 +4,8 @@
config, config,
... ...
}: { }: {
imports = [./navidrome]; imports = [
./audiobookshelf
./navidrome
];
} }