panacea/modules/audio.nix

65 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }:
let
soundcloud_token =
builtins.readFile /home/coolneng/.config/mopidy/soundcloud-auth;
in {
# Enable ALSA
sound.enable = true;
# Configure PulseAudio with mopidy tweaks
hardware.pulseaudio = {
enable = true;
tcp = {
enable = true;
anonymousClients.allowedIpRanges = [ "127.0.0.1" ];
};
};
# Set up Mopidy
services.mopidy = {
enable = true;
extensionPackages = [
pkgs.mopidy-mpd
pkgs.mopidy-soundcloud
pkgs.mopidy-youtube
pkgs.mopidy-somafm
];
configuration = ''
[audio]
mixer = none
mixer_volume =
output = pulsesink server=127.0.0.1
visualizer =
[file]
enabled = true
media_dirs = /home/coolneng/Music
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.png
.txt
[mpd]
zeroconf = ""
[http]
enabled = false
[soundcloud]
enabled = false
auth_token = ${soundcloud_token}
[m3u]
playlists_dir = /home/coolneng/.config/mpd/playlists
base_dir = /home/coolneng/Music
'';
};
}