From b98de88f02493a52c9bcc2a3256636e18bcc43dd Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:27:21 +0400 Subject: [PATCH] mopodiy --- modules/media/mopidy/default.nix | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 modules/media/mopidy/default.nix 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 + + + ''; + }; + }; +}