Merge pull request #5069 from ehmry/liquidsoap

Liquidsoap
This commit is contained in:
cillianderoiste 2014-11-21 00:41:06 +01:00
commit b462bd1960
6 changed files with 134 additions and 10 deletions

View File

@ -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!

View File

@ -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

View File

@ -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 );
};
}

View File

@ -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;

View File

@ -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;
};
}

View File

@ -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 { };