nixos/modules/media/mopidy/default.nix

50 lines
923 B
Nix
Raw Normal View History

2024-02-05 10:27:21 +04:00
{
config,
options,
2024-02-06 12:38:42 +04:00
pkgs,
2024-02-05 10:27:21 +04:00
lib,
...
}:
2024-08-01 16:24:09 +04:00
let
2024-02-05 10:27:21 +04:00
cfg = config.modules.media.mopidy;
in {
options.modules.media.mopidy = {
2024-08-01 16:24:09 +04:00
enable = lib.mkEnableOption false;
2024-02-05 10:27:21 +04:00
};
2024-08-01 16:24:09 +04:00
config = lib.mkIf cfg.enable {
2024-02-05 10:27:21 +04:00
services.mopidy = {
enable = true;
extensionPackages = with pkgs; [
mopidy-jellyfin
mopidy-mpd
];
configuration = ''
[core]
max_tracklist_length = 10000
restore_state = false
[audio]
mixer = software
mixer_volume =
output = autoaudiosink
buffer_time =
[jellyfin]
2024-02-06 12:55:13 +04:00
hostname = jellyfin.sako.box
2024-02-05 10:27:21 +04:00
username = sako
password = sako
libraries = Music
albumartistsort = False
album_format = {ProductionYear} - {Name}
[mpd]
enabled = True
hostname = 127.0.0.1
2024-02-06 12:50:10 +04:00
port = 6600
connection_timeout = 300
2024-02-05 10:27:21 +04:00
'';
};
};
}