From c1f458eb85147b6eb6baff0f7873da7bc111957e Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 24 Aug 2014 11:29:49 -0400 Subject: [PATCH 1/3] initial liquidsoap package expression --- pkgs/tools/audio/liquidsoap/full.nix | 45 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 47 insertions(+) create mode 100644 pkgs/tools/audio/liquidsoap/full.nix diff --git a/pkgs/tools/audio/liquidsoap/full.nix b/pkgs/tools/audio/liquidsoap/full.nix new file mode 100644 index 000000000000..30b608c5ba4d --- /dev/null +++ b/pkgs/tools/audio/liquidsoap/full.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchurl, which, pkgconfig +, ocaml, ocamlPackages +, libao, portaudio, alsaLib, pulseaudio, jack2 +, libsamplerate, libmad, taglib, lame, libogg +, libvorbis, speex, libtheora, libopus, fdk_aac +, faad2, flac, ladspaH, ffmpeg, frei0r, dssi +, }: + +let + version = "1.1.1"; + + packageFilters = map (p: "-e '/ocaml-${p}/d'" ) + [ "gstreamer" "shine" "aacplus" "schroedinger" + "voaacenc" "soundtouch" "gavl" "lo" + ]; +in +stdenv.mkDerivation { + name = "liquidsoap-full-${version}"; + + src = fetchurl { + url = "mirror://sourceforge/project/savonet/liquidsoap/${version}/liquidsoap-${version}-full.tar.gz"; + sha256 = "1w1grgja5yibph90vsxj7ffkpz1sgzmr54jj52s8889dpy609wqa"; + }; + + preConfigure = "sed ${toString packageFilters} PACKAGES.default > PACKAGES"; + configureFlags = [ "--localstatedir=/var" ]; + + buildInputs = + [ which ocaml ocamlPackages.findlib pkgconfig + libao portaudio alsaLib pulseaudio jack2 + libsamplerate libmad taglib lame libogg + libvorbis speex libtheora libopus fdk_aac + faad2 flac ladspaH ffmpeg frei0r dssi + ocamlPackages.xmlm ocamlPackages.ocaml_pcre + ocamlPackages.camomile + ]; + + meta = with stdenv.lib; { + description = "Swiss-army knife for multimedia streaming"; + homepage = http://liquidsoap.fm/; + maintainers = with maintainers; [ emery ]; + license = licenses.gpl2; + platform = ocaml.meta.platforms; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 03c24a961bdc..e310dccd6216 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1545,6 +1545,8 @@ let less = callPackage ../tools/misc/less { }; + liquidsoap = callPackage ../tools/audio/liquidsoap/full.nix { }; + lockfileProgs = callPackage ../tools/misc/lockfile-progs { }; logstash = callPackage ../tools/misc/logstash { }; From 21e4ff562409747a4ce18ffd61375db8dcd8116f Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 20 Nov 2014 17:30:24 -0500 Subject: [PATCH 2/3] initial liquidsoap service expression --- nixos/modules/misc/ids.nix | 2 + nixos/modules/module-list.nix | 1 + nixos/modules/services/audio/liquidsoap.nix | 74 +++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 nixos/modules/services/audio/liquidsoap.nix diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 0b836cb2903a..b08082af3529 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -162,6 +162,7 @@ systemd-network = 152; systemd-resolve = 153; systemd-timesync = 154; + liquidsoap = 155; # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! @@ -290,6 +291,7 @@ systemd-network = 152; systemd-resolve = 153; systemd-timesync = 154; + liquidsoap = 155; # When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399! diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index fcea0fed3808..19d69185392b 100755 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -89,6 +89,7 @@ ./services/audio/alsa.nix # Disabled as fuppes it does no longer builds. # ./services/audio/fuppes.nix + ./services/audio/liquidsoap.nix ./services/audio/mpd.nix ./services/audio/mopidy.nix ./services/backup/almir.nix diff --git a/nixos/modules/services/audio/liquidsoap.nix b/nixos/modules/services/audio/liquidsoap.nix new file mode 100644 index 000000000000..bf67d2399ebb --- /dev/null +++ b/nixos/modules/services/audio/liquidsoap.nix @@ -0,0 +1,74 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + streams = builtins.attrNames config.services.liquidsoap.streams; + + streamService = + name: + let stream = builtins.getAttr name config.services.liquidsoap.streams; in + { inherit name; + value = { + after = [ "network-online.target" "sound.target" ]; + description = "${name} liquidsoap stream"; + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.wget ]; + preStart = + '' + mkdir -p /var/log/liquidsoap + chown liquidsoap -R /var/log/liquidsoap + ''; + serviceConfig = { + PermissionsStartOnly="true"; + ExecStart = "${pkgs.liquidsoap}/bin/liquidsoap ${stream}"; + User = "liquidsoap"; + }; + }; + }; +in +{ + + ##### interface + + options = { + + services.liquidsoap.streams = mkOption { + + description = + '' + Set of Liquidsoap streams to start, + one systemd service per stream. + ''; + + default = {}; + + example = { + myStream1 = literalExample "\"/etc/liquidsoap/myStream1.liq\""; + myStream2 = literalExample "./myStream2.liq"; + myStream3 = literalExample "\"out(playlist(\"/srv/music/\"))\""; + }; + + type = types.attrsOf (types.either types.path types.str); + }; + + }; + ##### implementation + + config = mkIf (builtins.length streams != 0) { + + users.extraUsers.liquidsoap = { + uid = config.ids.uids.liquidsoap; + group = "liquidsoap"; + extraGroups = [ "audio" ]; + description = "Liquidsoap streaming user"; + home = "/var/lib/liquidsoap"; + createHome = true; + }; + + users.extraGroups.liquidsoap.gid = config.ids.gids.liquidsoap; + + systemd.services = builtins.listToAttrs ( map streamService streams ); + }; + +} From e6f70fd2b3c74ded46a6c310e7d972f885242c37 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 24 Aug 2014 13:29:26 -0400 Subject: [PATCH 3/3] icecast: update 2.3.3 to 2.4.0 now with opus support --- pkgs/servers/icecast/default.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/icecast/default.nix b/pkgs/servers/icecast/default.nix index 8b940fdb0cfc..6b8a75e6901a 100644 --- a/pkgs/servers/icecast/default.nix +++ b/pkgs/servers/icecast/default.nix @@ -1,28 +1,28 @@ {stdenv, fetchurl , libxml2, libxslt, curl -, libvorbis, libtheora, speex, libkate }: +, libvorbis, libtheora, speex, libkate, libopus }: stdenv.mkDerivation rec { - name = "icecast-2.3.3"; + name = "icecast-2.4.0"; src = fetchurl { url = "http://downloads.xiph.org/releases/icecast/${name}.tar.gz"; - sha256 = "0vf38mk13z1czpbj0g8va4rzjf201slqmiwcs8y9i6iwz3shc78v"; + sha256 = "0chg8v3c0wkbakjcw73rsfccx13f28arrmmbz9p5fsmiw5bykdqp"; }; - buildInputs = [ libxml2 libxslt curl libvorbis libtheora speex libkate ]; + buildInputs = [ libxml2 libxslt curl libvorbis libtheora speex libkate libopus ]; meta = { description = "Server software for streaming multimedia"; longDescription = '' - Icecast is a streaming media server which currently supports Ogg Vorbis and MP3 - audio streams. It can be used to create an Internet radio station or a - privately running jukebox and many things in between. It is very versatile in - that new formats can be added relatively easily and supports open standards for - commuincation and interaction. + Icecast is a streaming media server which currently supports + Ogg (Vorbis and Theora), Opus, WebM and MP3 audio streams. + It can be used to create an Internet radio station or a privately + running jukebox and many things in between. It is very versatile + in that new formats can be added relatively easily and supports + open standards for commuincation and interaction. ''; - homepage = http://www.icecast.org; license = stdenv.lib.licenses.gpl2;