panacea/modules/audio.nix

82 lines
1.6 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2020-06-01 19:38:59 +02:00
let
soundcloud_token =
builtins.readFile /home/coolneng/.config/mopidy/soundcloud-auth;
latest-mopidy-youtube = pkgs.mopidy-youtube.overrideAttrs (old: rec {
pname = "mopidy-youtube";
version = "3.2";
src = pkgs.python3Packages.fetchPypi {
inherit version;
pname = "Mopidy-YouTube";
sha256 = "0wmalfqnskglssq3gj6kkrq6h6c9yab503y72afhkm7n9r5c57zz";
};
});
2020-06-01 19:38:59 +02:00
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;
2020-11-25 00:24:04 +01:00
extensionPackages = with pkgs; [
mopidy-mpd
mopidy-soundcloud
latest-mopidy-youtube
2020-11-25 00:24:04 +01:00
mopidy-somafm
mopidy-local
];
configuration = ''
[audio]
2020-09-10 13:15:32 +02:00
mixer = software
mixer_volume =
output = pulsesink server=127.0.0.1
visualizer =
2020-11-01 12:27:56 +01:00
[local]
media_dir = /home/coolneng/Music
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.png
.txt
[mpd]
zeroconf = ""
[http]
enabled = false
[soundcloud]
2021-01-12 15:07:04 +01:00
enabled = true
2020-06-01 19:38:59 +02:00
auth_token = ${soundcloud_token}
[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-11-17 01:26:37 +01:00
[somafm]
encoding = aac
quality = highest
'';
};
}