mirror of
https://github.com/kmein/niveum
synced 2026-03-30 01:01:10 +02:00
feat(zaatar): add worldradio
This commit is contained in:
14
packages/worldradio.nix
Normal file
14
packages/worldradio.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{ jq, runCommand, fetchFromGitHub }:
|
||||||
|
let
|
||||||
|
online-radio = fetchFromGitHub {
|
||||||
|
owner = "josiahmokob0";
|
||||||
|
repo = "online-radio";
|
||||||
|
rev = "04d16421355196194a05e5504ba8f66a9c07ee7b";
|
||||||
|
sha256 = "1q0iagx7df0sd6vl5anvpzyiw4jdwa6c67z45rx622a6cr6m4zzl";
|
||||||
|
};
|
||||||
|
in runCommand "worldradio.m3u" {} ''
|
||||||
|
${jq}/bin/jq --raw-output --slurp 'flatten | map(.url_resolved) | .[]' ${online-radio}/src/data/countries/*.json \
|
||||||
|
| sort \
|
||||||
|
| uniq \
|
||||||
|
> $out
|
||||||
|
''
|
||||||
@@ -15,10 +15,16 @@
|
|||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages =
|
||||||
|
let
|
||||||
|
worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {};
|
||||||
|
in [
|
||||||
(pkgs.writers.writeDashBin "mpv" ''
|
(pkgs.writers.writeDashBin "mpv" ''
|
||||||
${pkgs.mpv}/bin/mpv --no-video "$@"
|
${pkgs.mpv}/bin/mpv --no-video "$@"
|
||||||
'')
|
'')
|
||||||
|
(pkgs.writers.writeDashBin "worldradio" ''
|
||||||
|
shuf ${worldradio} | ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv --no-video
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user