navidrome: configurable port

This commit is contained in:
Aly Raffauf 2024-06-08 10:04:44 -04:00
parent ae075c58d1
commit 678f551246

View file

@ -2,6 +2,7 @@
pkgs, pkgs,
lib, lib,
config, config,
self,
... ...
}: { }: {
options = { options = {
@ -12,32 +13,40 @@
default = "/mnt/Media/Music"; default = "/mnt/Media/Music";
type = lib.types.str; type = lib.types.str;
}; };
alyraffauf.containers.nixos.navidrome.port = lib.mkOption {
description = "Port for Navidrome.";
default = 4533;
type = lib.types.int;
};
}; };
config = lib.mkIf config.alyraffauf.containers.nixos.navidrome.enable { config = lib.mkIf config.alyraffauf.containers.nixos.navidrome.enable {
containers.navidrome = { containers.navidrome = {
autoStart = true; autoStart = true;
bindMounts."/Music".hostPath = config.alyraffauf.containers.nixos.navidrome.musicDirectory; bindMounts."/Music".hostPath = config.alyraffauf.containers.nixos.navidrome.musicDirectory;
config = { config = let
config, port = config.alyraffauf.containers.nixos.navidrome.port;
pkgs, in
lib, {
... config,
}: { pkgs,
system.stateVersion = "24.05"; lib,
services.navidrome = { ...
enable = true; }: {
openFirewall = true; system.stateVersion = "24.05";
settings = { services.navidrome = {
Address = "0.0.0.0"; enable = true;
Port = 4533; openFirewall = true;
MusicFolder = "/Music"; settings = {
DefaultTheme = "Auto"; Address = "0.0.0.0";
SubsonicArtistParticipations = true; Port = port;
UIWelcomeMessage = "Welcome to Navidrome! Registrations are closed."; MusicFolder = "/Music";
DefaultTheme = "Auto";
SubsonicArtistParticipations = true;
UIWelcomeMessage = "Welcome to Navidrome! Registrations are closed.";
};
}; };
}; };
};
}; };
}; };
} }