2024-04-07 22:16:33 -04:00
|
|
|
{
|
|
|
|
config,
|
2024-06-09 00:08:00 -04:00
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
2024-06-08 10:04:44 -04:00
|
|
|
self,
|
2024-04-07 22:16:33 -04:00
|
|
|
...
|
|
|
|
}: {
|
2024-03-28 16:13:46 -04:00
|
|
|
options = {
|
2024-04-22 20:18:47 -04:00
|
|
|
alyraffauf.containers.nixos.navidrome.enable =
|
|
|
|
lib.mkEnableOption "Enable navidrome nixos container.";
|
|
|
|
alyraffauf.containers.nixos.navidrome.musicDirectory = lib.mkOption {
|
|
|
|
description = "Music directory for Navidrome.";
|
|
|
|
default = "/mnt/Media/Music";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
2024-06-08 10:04:44 -04:00
|
|
|
alyraffauf.containers.nixos.navidrome.port = lib.mkOption {
|
|
|
|
description = "Port for Navidrome.";
|
|
|
|
default = 4533;
|
|
|
|
type = lib.types.int;
|
|
|
|
};
|
2024-03-28 16:13:46 -04:00
|
|
|
};
|
|
|
|
|
2024-04-22 20:18:47 -04:00
|
|
|
config = lib.mkIf config.alyraffauf.containers.nixos.navidrome.enable {
|
2024-06-09 00:08:00 -04:00
|
|
|
# Spotify secrets aren't exactly safe, because they are world-readable in the nix store.
|
|
|
|
# But they're reasonably disposable and hidden from the public git repo.
|
|
|
|
age.secrets.spotifyClientId.file = ../../../../secrets/spotify/clientId.age;
|
|
|
|
age.secrets.spotifyClientSecret.file = ../../../../secrets/spotify/clientSecret.age;
|
|
|
|
|
2024-03-28 16:13:46 -04:00
|
|
|
containers.navidrome = {
|
|
|
|
autoStart = true;
|
2024-04-22 20:18:47 -04:00
|
|
|
bindMounts."/Music".hostPath = config.alyraffauf.containers.nixos.navidrome.musicDirectory;
|
2024-06-08 10:04:44 -04:00
|
|
|
config = let
|
|
|
|
port = config.alyraffauf.containers.nixos.navidrome.port;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
system.stateVersion = "24.05";
|
|
|
|
services.navidrome = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
settings = {
|
|
|
|
Address = "0.0.0.0";
|
|
|
|
DefaultTheme = "Auto";
|
2024-06-09 00:08:00 -04:00
|
|
|
MusicFolder = "/Music";
|
|
|
|
Port = port;
|
2024-06-08 10:04:44 -04:00
|
|
|
SubsonicArtistParticipations = true;
|
|
|
|
UIWelcomeMessage = "Welcome to Navidrome! Registrations are closed.";
|
|
|
|
};
|
2024-03-28 16:13:46 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-03-28 16:40:23 -04:00
|
|
|
}
|