diff --git a/modules/media/mopidy/default.nix b/modules/media/mopidy/default.nix new file mode 100644 index 00000000..597aa95f --- /dev/null +++ b/modules/media/mopidy/default.nix @@ -0,0 +1,51 @@ +{ + config, + options, + lib, + ... +}: +with lib; let + cfg = config.modules.media.mopidy; +in { + options.modules.media.mopidy = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + services.mopidy = { + enable = true; + extensionPackages = with pkgs; [ + mopidy-jellyfin + mopidy-mpd + ]; + configuration = '' + [core] + cache_dir = $XDG_CACHE_DIR/mopidy + config_dir = $XDG_CONFIG_DIR/mopidy + data_dir = $XDG_DATA_DIR/mopidy + max_tracklist_length = 10000 + restore_state = false + + [audio] + mixer = software + mixer_volume = + output = autoaudiosink + buffer_time = + + [jellyfin] + hostname = https://jellyfin.sako.box + username = sako + password = sako + libraries = Music + albumartistsort = False + album_format = {ProductionYear} - {Name} + + [mpd] + enabled = True + hostname = 127.0.0.1 + + + ''; + }; + }; +}