From b6e77f77afdfd491704cdf505c002fec0b0e134a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Thu, 29 Oct 2020 07:54:57 +0100 Subject: [PATCH] feat(mpd): split playlists --- configs/mpd.nix | 10 +++-- lib/mpd-playlists.nix | 98 ++++++++++++++++++++++++++++++++++++++++++ lib/radio-stations.nix | 38 ---------------- 3 files changed, 105 insertions(+), 41 deletions(-) create mode 100644 lib/mpd-playlists.nix delete mode 100644 lib/radio-stations.nix diff --git a/configs/mpd.nix b/configs/mpd.nix index 038c0a8..9f22669 100644 --- a/configs/mpd.nix +++ b/configs/mpd.nix @@ -1,12 +1,16 @@ { config, pkgs, lib, ... }: let - radioStations = import ; - radioStationsFile = pkgs.writeText "stations" (lib.concatStringsSep "\n" radioStations); + playlists = import ; + playlistFiles = lib.mapAttrs (name: streams: pkgs.writeText name (lib.concatStringsSep "\n" streams)) playlists; + linkPlaylist = name: file: '' + ln -sfn ${toString file} /var/lib/mpd/playlists/${name}.m3u + ''; + linkPlaylists = lib.concatStringsSep "\n" (lib.mapAttrsToList linkPlaylist playlistFiles); in { system.activationScripts.webradio = '' install -d /var/lib/mpd/playlists - ln -sfn ${toString radioStationsFile} /var/lib/mpd/playlists/webradio.m3u + ${linkPlaylists} ''; services.mpd.enable = true; diff --git a/lib/mpd-playlists.nix b/lib/mpd-playlists.nix new file mode 100644 index 0000000..cc653c2 --- /dev/null +++ b/lib/mpd-playlists.nix @@ -0,0 +1,98 @@ +{ + SomaFM = [ + "http://ice1.somafm.com/specials-128-aac" # For Halloween: Dark industrial/ambient music for tortured souls. + "http://ice5.somafm.com/deepspaceone-128-aac" # Deep ambient electronic, experimental and space music. For inner and outer space exploration. + "http://ice5.somafm.com/beatblender-128-aac" # A late night blend of deep-house and downtempo chill. + "http://ice5.somafm.com/defcon-128-aac" # Music for Hacking. The DEF CON Year-Round Channel. + "http://ice5.somafm.com/sonicuniverse-128-aac" # Transcending the world of jazz with eclectic, avant-garde takes on tradition. + "http://ice5.somafm.com/reggae-128-aac" # NEW! Reggae, Ska, Rocksteady classic and deep tracks. + "http://ice6.somafm.com/7soul-128-aac" # Vintage soul tracks from the original 45 RPM vinyl. + "http://ice3.somafm.com/seventies-128-aac" # Mellow album rock from the Seventies. Yacht not required. + "http://ice3.somafm.com/u80s-128-aac" # Early 80s UK Synthpop and a bit of New Wave. + "http://ice2.somafm.com/secretagent-128-aac" # The soundtrack for your stylish, mysterious, dangerous life. For Spies and PIs too! + "http://ice5.somafm.com/thistle-128-aac" # Exploring music from Celtic roots and branches + "http://ice5.somafm.com/fluid-128-aac" # Drown in the electronic sound of instrumental hiphop, future soul and liquid trap. + "http://ice3.somafm.com/poptron-128-aac" # Electropop and indie dance rock with sparkle and pop. + "http://ice3.somafm.com/illstreet-128-aac" # Classic bachelor pad, playful exotica and vintage music of tomorrow. + "http://ice3.somafm.com/bagel-128-aac" # What alternative rock radio should sound like. [explicit] + "http://ice3.somafm.com/indiepop-128-aac" # New and classic favorite indie pop tracks. + "http://ice3.somafm.com/digitalis-128-aac" # Digitally affected analog rock to calm the agitated heart. + "http://ice5.somafm.com/folkfwd-128-aac" # Indie Folk, Alt-folk and the occasional folk classics. + "http://ice5.somafm.com/cliqhop-128-aac" # Blips'n'beeps backed mostly w/beats. Intelligent Dance Music. + "http://ice2.somafm.com/dubstep-128-aac" # Dubstep, Dub and Deep Bass. May damage speakers at high volume. + "http://ice2.somafm.com/suburbsofgoa-128-aac" # Desi-influenced Asian world beats and beyond. + "http://ice2.somafm.com/sf1033-128-aac" # Ambient music mixed with the sounds of San Francisco public safety radio traffic. + "http://ice5.somafm.com/missioncontrol-128-aac" # Celebrating NASA and Space Explorers everywhere. + "http://ice5.somafm.com/scanner-128-aac" # San Francisco Public Safety Scanner Feed + "http://ice2.somafm.com/metal-128-mp3" # From black to doom, prog to sludge, thrash to post, stoner to crossover, punk to industrial. + "http://ice2.somafm.com/covers-128-aac" # Just covers. Songs you know by artists you don't. We've got you covered. + "http://ice5.somafm.com/brfm-128-aac" # From the Playa to the world, for the annual Burning Man festival. + "http://ice1.somafm.com/live-128-aac" # Special Live Events and rebroadcasts of past live events + "http://ice1.somafm.com/xmasinfrisko-128-aac" # SomaFM's wacky and eclectic holiday mix. Not for the easily offended. + "http://ice2.somafm.com/christmas-128-aac" # Chilled holiday grooves and classic winter lounge tracks. (Kid and Parent safe!) + "http://ice2.somafm.com/xmasrocks-128-aac" # Have your self an indie/alternative holiday season! + "http://ice6.somafm.com/jollysoul-128-aac" # Where we cut right to the soul of the season. + "http://ice2.somafm.com/vaporwaves-128-aac" # All Vaporwave. All the time. + "http://ice6.somafm.com/dronezone-128-aac" # Served best chilled, safe with most medications. Atmospheric textures with minimal beats. + "http://ice5.somafm.com/groovesalad-128-aac" # A nicely chilled plate of ambient/downtempo beats and grooves. + "http://ice2.somafm.com/gsclassic-128-aac" # The classic (early 2000s) version of a nicely chilled plate of ambient/downtempo beats and grooves. + "http://ice5.somafm.com/bootliquor-128-aac" # Americana Roots music for Cowhands, Cowpokes and Cowtippers + "http://ice2.somafm.com/lush-128-aac" # Sensuous and mellow vocals, mostly female, with an electronic influence. + "http://ice1.somafm.com/silent-128-aac" + "http://ice6.somafm.com/spacestation-128-aac" # Tune in, turn on, space out. Spaced-out ambient and mid-tempo electronica. + "http://ice2.somafm.com/thetrip-128-aac" # Progressive house / trance. Tip top tunes. + ]; + "DI.FM" = [ + "http://prem2.di.fm:80/bassline_hi?4527f2ba1755917" + "http://prem2.di.fm:80/breaks_hi?4527f2ba1755917" + "http://prem2.di.fm:80/chillout_hi?4527f2ba1755917" + "http://prem2.di.fm:80/classicelectronica_hi?4527f2ba1755917" + "http://prem2.di.fm:80/deephouse_hi?4527f2ba1755917" + "http://prem2.di.fm:80/djmixes_hi?4527f2ba1755917" + "http://prem2.di.fm:80/drumandbass_hi?4527f2ba1755917" + "http://prem2.di.fm:80/drumstep_hi?4527f2ba1755917" + "http://prem2.di.fm:80/dub_hi?4527f2ba1755917" + "http://prem2.di.fm:80/dubstep_hi?4527f2ba1755917" + "http://prem2.di.fm:80/electrohouse_hi?4527f2ba1755917" + "http://prem2.di.fm:80/electroswing_hi?4527f2ba1755917" + "http://prem2.di.fm:80/glitchhop_hi?4527f2ba1755917" + "http://prem2.di.fm:80/handsup_hi?4527f2ba1755917" + "http://prem2.di.fm:80/hardtechno_hi?4527f2ba1755917" + "http://prem2.di.fm:80/liquiddnb_hi?4527f2ba1755917" + "http://prem2.di.fm:80/liquiddubstep_hi?4527f2ba1755917" + "http://prem2.di.fm:80/lounge_hi?4527f2ba1755917" + "http://prem2.di.fm:80/minimal_hi?4527f2ba1755917" + "http://prem2.di.fm:80/progressive_hi?4527f2ba1755917" + "http://prem2.di.fm:80/progressivepsy_hi?4527f2ba1755917" + "http://prem2.di.fm:80/techhouse_hi?4527f2ba1755917" + "http://prem2.di.fm:80/trap_hi?4527f2ba1755917" + ]; + Misc = [ + "https://radio.lassul.us/radio.ogg" + "http://bytefm.cast.addradio.de/bytefm/main/mid/stream" + ]; + BigFM = [ + "https://streams.bigfm.de/bigfm-deutschland-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-charts-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-hiphop-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-deutschrap-128-aac?usid=0-0-H-A-D-30s" + "https://streams.bigfm.de/bigfm-usrap-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-oldschool-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-dance-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-mashup-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-sunsetlounge-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-reggaevibes-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-latinbeats-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-groovenight-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-rapfeature-128-aac?usid=0-0-H-A-D-01" + "https://streams.bigfm.de/bigfm-urbanclubbeats-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-oldschooldeutsch-128-aac?usid=0-0-H-A-D-01" + "https://streams.bigfm.de/bigfm-nitroxedm-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-nitroxdeep-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-worldbeats-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-turkey-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-balkan-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-orient-128-aac?usid=0-0-H-A-D-30" + "https://streams.bigfm.de/bigfm-russia-128-mp3?usid=0-0-H-A-D-01" + ]; +} diff --git a/lib/radio-stations.nix b/lib/radio-stations.nix deleted file mode 100644 index fd49c58..0000000 --- a/lib/radio-stations.nix +++ /dev/null @@ -1,38 +0,0 @@ -[ - "http://ice1.somafm.com/beatblender-128-aac" - "http://ice1.somafm.com/defcon-128-aac" - "http://ice1.somafm.com/vaporwaves-128-aac" - "http://ice1.somafm.com/dronezone-128-aac" - "http://ice1.somafm.com/dubstep-128-aac" - "http://ice1.somafm.com/groovesalad-32-aac" - "http://ice1.somafm.com/gsclassic-128-aac" - "http://ice1.somafm.com/bootliquor-128-aac" - "http://ice1.somafm.com/lush-128-aac" - "http://ice1.somafm.com/silent-128-aac" - "http://ice1.somafm.com/spacestation-128-aac" - "http://ice1.somafm.com/thetrip-128-aac" - "http://prem2.di.fm:80/bassline_hi?4527f2ba1755917" - "http://prem2.di.fm:80/breaks_hi?4527f2ba1755917" - "http://prem2.di.fm:80/chillout_hi?4527f2ba1755917" - "http://prem2.di.fm:80/classicelectronica_hi?4527f2ba1755917" - "http://prem2.di.fm:80/deephouse_hi?4527f2ba1755917" - "http://prem2.di.fm:80/djmixes_hi?4527f2ba1755917" - "http://prem2.di.fm:80/drumandbass_hi?4527f2ba1755917" - "http://prem2.di.fm:80/drumstep_hi?4527f2ba1755917" - "http://prem2.di.fm:80/dub_hi?4527f2ba1755917" - "http://prem2.di.fm:80/dubstep_hi?4527f2ba1755917" - "http://prem2.di.fm:80/electrohouse_hi?4527f2ba1755917" - "http://prem2.di.fm:80/electroswing_hi?4527f2ba1755917" - "http://prem2.di.fm:80/glitchhop_hi?4527f2ba1755917" - "http://prem2.di.fm:80/handsup_hi?4527f2ba1755917" - "http://prem2.di.fm:80/hardtechno_hi?4527f2ba1755917" - "http://prem2.di.fm:80/liquiddnb_hi?4527f2ba1755917" - "http://prem2.di.fm:80/liquiddubstep_hi?4527f2ba1755917" - "http://prem2.di.fm:80/lounge_hi?4527f2ba1755917" - "http://prem2.di.fm:80/minimal_hi?4527f2ba1755917" - "http://prem2.di.fm:80/progressive_hi?4527f2ba1755917" - "http://prem2.di.fm:80/progressivepsy_hi?4527f2ba1755917" - "http://prem2.di.fm:80/techhouse_hi?4527f2ba1755917" - "http://prem2.di.fm:80/trap_hi?4527f2ba1755917" - "https://radio.lassul.us/radio.ogg" -]