2020-05-09 01:17:35 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2021-08-10 00:15:57 +02:00
|
|
|
let soundcloud_token = builtins.readFile ../secrets/soundcloud_token;
|
|
|
|
|
|
|
|
in {
|
2021-03-22 16:27:03 +01:00
|
|
|
# Configure pipewire as sound server
|
|
|
|
services.pipewire = {
|
2020-05-09 01:17:35 +02:00
|
|
|
enable = true;
|
2022-01-19 02:00:06 +01:00
|
|
|
media-session.enable = false;
|
2021-03-22 16:27:03 +01:00
|
|
|
alsa = {
|
2020-05-09 01:17:35 +02:00
|
|
|
enable = true;
|
2021-03-22 16:27:03 +01:00
|
|
|
support32Bit = true;
|
2020-05-09 01:17:35 +02:00
|
|
|
};
|
2021-03-22 16:27:03 +01:00
|
|
|
pulse.enable = true;
|
|
|
|
jack.enable = true;
|
2021-03-31 00:31:17 +02:00
|
|
|
config.pipewire-pulse."context.modules" = [
|
|
|
|
{
|
|
|
|
"args" = { };
|
|
|
|
"flags" = [ "ifexists" "nofail" ];
|
|
|
|
"name" = "libpipewire-module-rtkit";
|
|
|
|
}
|
|
|
|
{ "name" = "libpipewire-module-protocol-native"; }
|
|
|
|
{ "name" = "libpipewire-module-client-node"; }
|
|
|
|
{ "name" = "libpipewire-module-adapter"; }
|
|
|
|
{ "name" = "libpipewire-module-metadata"; }
|
|
|
|
{
|
|
|
|
"args" = { "server.address" = [ "unix:native" "tcp:4713" ]; };
|
|
|
|
"name" = "libpipewire-module-protocol-pulse";
|
|
|
|
}
|
|
|
|
];
|
2020-05-09 01:17:35 +02:00
|
|
|
};
|
2021-03-22 16:27:03 +01:00
|
|
|
security.rtkit.enable = true;
|
2022-01-19 02:00:06 +01:00
|
|
|
services.pipewire.wireplumber.enable = true;
|
2020-05-11 06:40:41 +02:00
|
|
|
|
|
|
|
# Set up Mopidy
|
|
|
|
services.mopidy = {
|
|
|
|
enable = true;
|
2020-11-25 00:24:04 +01:00
|
|
|
extensionPackages = with pkgs; [
|
|
|
|
mopidy-mpd
|
|
|
|
mopidy-soundcloud
|
2021-08-08 20:56:16 +02:00
|
|
|
mopidy-youtube
|
2020-11-25 00:24:04 +01:00
|
|
|
mopidy-somafm
|
|
|
|
mopidy-local
|
2020-05-23 15:43:54 +02:00
|
|
|
];
|
2020-05-11 06:40:41 +02:00
|
|
|
configuration = ''
|
|
|
|
[audio]
|
|
|
|
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]
|
2021-01-12 15:07:04 +01:00
|
|
|
enabled = true
|
2021-08-10 00:15:57 +02:00
|
|
|
auth_token = ${soundcloud_token}
|
2021-01-14 12:56:13 +01:00
|
|
|
explore_songs = 100
|
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-11-17 01:26:37 +01:00
|
|
|
|
|
|
|
[somafm]
|
|
|
|
encoding = aac
|
|
|
|
quality = highest
|
2020-05-11 06:40:41 +02:00
|
|
|
'';
|
|
|
|
};
|
2020-05-09 01:17:35 +02:00
|
|
|
}
|