mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-25 14:31:54 -05:00
containers: added native nix audiobookshelf container
This commit is contained in:
parent
678f551246
commit
318eda3b4a
47
nixosModules/containers/nixos/audiobookshelf/default.nix
Normal file
47
nixosModules/containers/nixos/audiobookshelf/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -4,5 +4,8 @@
|
|||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [./navidrome];
|
||||
imports = [
|
||||
./audiobookshelf
|
||||
./navidrome
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue