2020-05-09 01:17:35 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2020-06-01 19:38:59 +02:00
|
|
|
let
|
|
|
|
soundcloud_token =
|
|
|
|
builtins.readFile /home/coolneng/.config/mopidy/soundcloud-auth;
|
|
|
|
|
|
|
|
in {
|
2020-05-11 06:40:41 +02:00
|
|
|
# Enable ALSA
|
|
|
|
sound.enable = true;
|
2020-05-09 01:17:35 +02:00
|
|
|
|
2020-05-11 06:40:41 +02:00
|
|
|
# Configure PulseAudio with mopidy tweaks
|
2020-05-09 01:17:35 +02:00
|
|
|
hardware.pulseaudio = {
|
|
|
|
enable = true;
|
|
|
|
tcp = {
|
|
|
|
enable = true;
|
|
|
|
anonymousClients.allowedIpRanges = [ "127.0.0.1" ];
|
|
|
|
};
|
|
|
|
};
|
2020-05-11 06:40:41 +02:00
|
|
|
|
|
|
|
# Set up Mopidy
|
|
|
|
services.mopidy = {
|
|
|
|
enable = true;
|
2020-05-23 15:43:54 +02:00
|
|
|
extensionPackages = [
|
|
|
|
pkgs.mopidy-mpd
|
2020-06-01 19:38:59 +02:00
|
|
|
pkgs.mopidy-soundcloud
|
|
|
|
pkgs.mopidy-youtube
|
|
|
|
pkgs.mopidy-somafm
|
2020-11-01 12:27:56 +01:00
|
|
|
pkgs.mopidy-local
|
2020-05-23 15:43:54 +02:00
|
|
|
];
|
2020-05-11 06:40:41 +02:00
|
|
|
configuration = ''
|
|
|
|
[audio]
|
2020-09-10 13:15:32 +02:00
|
|
|
mixer = software
|
2020-05-11 06:40:41 +02:00
|
|
|
mixer_volume =
|
|
|
|
output = pulsesink server=127.0.0.1
|
|
|
|
visualizer =
|
|
|
|
|
2020-11-01 12:27:56 +01:00
|
|
|
[local]
|
|
|
|
media_dir = /home/coolneng/Music
|
2020-05-11 06:40:41 +02:00
|
|
|
excluded_file_extensions =
|
|
|
|
.directory
|
|
|
|
.html
|
|
|
|
.jpeg
|
|
|
|
.jpg
|
|
|
|
.log
|
|
|
|
.nfo
|
|
|
|
.png
|
|
|
|
.txt
|
|
|
|
|
|
|
|
[mpd]
|
|
|
|
zeroconf = ""
|
|
|
|
|
|
|
|
[http]
|
|
|
|
enabled = false
|
|
|
|
|
|
|
|
[soundcloud]
|
|
|
|
enabled = false
|
2020-06-01 19:38:59 +02:00
|
|
|
auth_token = ${soundcloud_token}
|
2020-05-11 06:40:41 +02:00
|
|
|
|
|
|
|
[m3u]
|
|
|
|
playlists_dir = /home/coolneng/.config/mpd/playlists
|
|
|
|
base_dir = /home/coolneng/Music
|
2020-10-05 12:48:44 +02:00
|
|
|
|
|
|
|
[youtube]
|
|
|
|
search_results = 50
|
2020-05-11 06:40:41 +02:00
|
|
|
'';
|
|
|
|
};
|
2020-05-09 01:17:35 +02:00
|
|
|
}
|