Compare commits
3 Commits
75a6b01fc6
...
1956c75a61
Author | SHA1 | Date |
---|---|---|
Tim Van Baak | 1956c75a61 | |
Tim Van Baak | 89e1752d0e | |
Tim Van Baak | 612fcb7dce |
|
@ -33,9 +33,53 @@
|
|||
];
|
||||
|
||||
users.users.tvb.extraGroups = [
|
||||
"mopidy"
|
||||
"networkmanager"
|
||||
"pipewire"
|
||||
];
|
||||
|
||||
users.groups.mopidy = {}; # rw group for media directory
|
||||
users.users.mopidy.extraGroups = [
|
||||
"mopidy"
|
||||
"pipewire" # necessary to allow the system service to play sound
|
||||
];
|
||||
services.mopidy = let
|
||||
mopidy-ytdlp = pkgs.callPackage ./mopidy-youtube.nix { };
|
||||
in {
|
||||
enable = true;
|
||||
extensionPackages = with pkgs; [
|
||||
mopidy-musicbox-webclient
|
||||
# Replace the default mopidy-youtube, which doesn't have yt-dlp or a way to inject it
|
||||
mopidy-ytdlp
|
||||
];
|
||||
configuration = ''
|
||||
[file]
|
||||
media_dirs =
|
||||
/media/music|Music
|
||||
|
||||
[youtube]
|
||||
youtube_dl_package = yt_dlp
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
virtualHosts = {
|
||||
default = {
|
||||
default = true;
|
||||
locations."/".return = "444";
|
||||
};
|
||||
"centroid.lan" = {
|
||||
listen = [ { addr = "centroid.lan"; } ];
|
||||
locations."/" = {
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://localhost:6680";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, python3
|
||||
, mopidy
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "mopidy-youtube";
|
||||
version = "3.6";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "natumbri";
|
||||
repo = pname;
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-Mp8eCVNGokJRwmYiZYCYRwV1QVDV02Uqfh6fGcPgJss=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
beautifulsoup4
|
||||
cachetools
|
||||
pykka
|
||||
requests
|
||||
youtube-dl # this no longer works
|
||||
yt-dlp # <- added
|
||||
ytmusicapi
|
||||
] ++ [
|
||||
mopidy
|
||||
];
|
||||
|
||||
nativeCheckInputs = with python3.pkgs; [
|
||||
vcrpy
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# Test requires a YouTube API key
|
||||
"test_get_default_config"
|
||||
];
|
||||
|
||||
disabledTestPaths = [
|
||||
# Disable tests which interact with Youtube
|
||||
"tests/test_api.py"
|
||||
"tests/test_backend.py"
|
||||
"tests/test_youtube.py"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"mopidy_youtube"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Mopidy extension for playing music from YouTube";
|
||||
homepage = "https://github.com/natumbri/mopidy-youtube";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue