2022-05-01 19:50:01 +02:00
|
|
|
{ config, lib, pkgs, inputs, ... }:
|
2020-05-09 01:17:35 +02:00
|
|
|
|
2022-04-25 04:02:37 +02:00
|
|
|
with pkgs;
|
|
|
|
|
|
|
|
let
|
2022-09-04 08:06:02 +02:00
|
|
|
# HACK Replace youtube-dl with yt-dlp in mopidy-youtube
|
2022-04-25 04:02:37 +02:00
|
|
|
mopidy-youtube-yt_dlp = mopidy-youtube.overrideAttrs (old: rec {
|
2022-09-04 08:06:02 +02:00
|
|
|
src = python3Packages.fetchPypi {
|
|
|
|
version = "3.6";
|
|
|
|
pname = "Mopidy-YouTube";
|
|
|
|
sha256 = "sha256-92tJpCu0S79Z1yYaQUnNMxN1rD+8Wr0rtt4GVnldZ9A=";
|
|
|
|
};
|
|
|
|
|
2022-04-25 04:02:37 +02:00
|
|
|
propagatedBuildInputs = old.propagatedBuildInputs
|
|
|
|
++ [ python3.pkgs.yt-dlp ];
|
|
|
|
});
|
2022-09-04 08:06:02 +02:00
|
|
|
latest-mopidy-somafm = mopidy-somafm.overrideAttrs (old: rec {
|
|
|
|
src = python3Packages.fetchPypi {
|
|
|
|
version = "2.0.2";
|
|
|
|
pname = "Mopidy-SomaFM";
|
|
|
|
sha256 = "DC0emxkoWfjGHih2C8nINBFByf521Xf+3Ks4JRxNPLM=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
soundcloud_token = builtins.readFile ../secrets/soundcloud_token;
|
|
|
|
latest-mopidy-soundcloud = mopidy-soundcloud.overrideAttrs (old: rec {
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mopidy";
|
|
|
|
repo = "mopidy-soundcloud";
|
|
|
|
rev = "fc766b0bf17feb4fc989029b92a315a10ff453ee";
|
|
|
|
sha256 = "sha256-LftBbfs5KqqkhFQVZRh/AQKQQ+18x8RapRU1mTB7FD8=";
|
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = old.propagatedBuildInputs
|
|
|
|
++ [ python3.pkgs.beautifulsoup4 ];
|
|
|
|
});
|
|
|
|
|
2022-04-25 04:02:37 +02:00
|
|
|
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;
|
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;
|
2022-02-14 23:54:08 +01:00
|
|
|
wireplumber.enable = true;
|
2022-05-01 19:50:01 +02:00
|
|
|
config.pipewire-pulse = let
|
|
|
|
defaultConf = lib.importJSON
|
|
|
|
"${inputs.nixpkgs}/nixos/modules/services/desktops/pipewire/daemon/pipewire-pulse.conf.json";
|
|
|
|
in lib.recursiveUpdate defaultConf {
|
2022-05-01 23:09:20 +02:00
|
|
|
"pulse.properties" = {
|
|
|
|
"server.address" = [ "unix:native" "tcp:127.0.0.1:4713" ];
|
|
|
|
};
|
2022-05-01 19:50:01 +02:00
|
|
|
};
|
2020-05-09 01:17:35 +02:00
|
|
|
};
|
2021-03-22 16:27:03 +01:00
|
|
|
security.rtkit.enable = true;
|
2020-05-11 06:40:41 +02:00
|
|
|
|
|
|
|
# Set up Mopidy
|
|
|
|
services.mopidy = {
|
|
|
|
enable = true;
|
2022-09-04 08:06:02 +02:00
|
|
|
extensionPackages = [
|
|
|
|
mopidy-mpd
|
|
|
|
mopidy-local
|
|
|
|
mopidy-youtube-yt_dlp
|
|
|
|
latest-mopidy-somafm
|
|
|
|
latest-mopidy-soundcloud
|
|
|
|
];
|
2020-05-11 06:40:41 +02:00
|
|
|
configuration = ''
|
|
|
|
[audio]
|
|
|
|
output = pulsesink server=127.0.0.1
|
|
|
|
|
2020-11-01 12:27:56 +01:00
|
|
|
[local]
|
|
|
|
media_dir = /home/coolneng/Music
|
2022-03-29 23:55:26 +02:00
|
|
|
directories =
|
|
|
|
Album Artists local:directory?type=artist&role=albumartist
|
|
|
|
Albums local:directory?type=album
|
|
|
|
Artists local:directory?type=artist
|
|
|
|
Genres local:directory?type=genre
|
2020-05-11 06:40:41 +02:00
|
|
|
excluded_file_extensions =
|
|
|
|
.directory
|
|
|
|
.html
|
|
|
|
.jpeg
|
|
|
|
.jpg
|
|
|
|
.log
|
|
|
|
.nfo
|
|
|
|
.png
|
|
|
|
.txt
|
|
|
|
|
|
|
|
[mpd]
|
|
|
|
zeroconf = ""
|
|
|
|
|
|
|
|
[m3u]
|
|
|
|
playlists_dir = /home/coolneng/.config/mpd/playlists
|
|
|
|
base_dir = /home/coolneng/Music
|
2020-10-05 12:48:44 +02:00
|
|
|
|
|
|
|
[youtube]
|
2022-03-31 16:15:36 +02:00
|
|
|
allow_cache = true
|
2020-10-05 12:48:44 +02:00
|
|
|
search_results = 50
|
2022-04-25 04:02:37 +02:00
|
|
|
youtube_dl_package = yt_dlp
|
2020-11-17 01:26:37 +01:00
|
|
|
|
|
|
|
[somafm]
|
|
|
|
encoding = aac
|
|
|
|
quality = highest
|
2022-09-04 08:06:02 +02:00
|
|
|
|
|
|
|
[soundcloud]
|
|
|
|
auth_token = ${soundcloud_token}
|
|
|
|
explore_songs = 100
|
2020-05-11 06:40:41 +02:00
|
|
|
'';
|
|
|
|
};
|
2020-05-09 01:17:35 +02:00
|
|
|
}
|