git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #5069 from ehmry/liquidsoap

Liquidsoap

commitb462bd1960de86ff9693e196e2ce2a3e27b649c0 authorcillianderoiste <cillian.deroiste@gmail.com> dateFri 21 Nov 2014, 00:41 (12 years ago) parentcee89efe6f70fd
6 files changed+134−10
nixos/modules/misc/ids.nix+2 nixos/modules/module-list.nix+1 nixos/modules/services/audio/liquidsoap.nix+74 pkgs/servers/icecast/default.nix+10−10 pkgs/tools/audio/liquidsoap/full.nix+45 pkgs/top-level/all-packages.nix+2
nixos/modules/misc/ids.nix+2
@@ -162,6 +162,7 @@
162162 systemd-network = 152;
163163 systemd-resolve = 153;
164164 systemd-timesync = 154;
165+ liquidsoap = 155;
165166
166167 # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
167168
@@ -290,6 +291,7 @@
290291 systemd-network = 152;
291292 systemd-resolve = 153;
292293 systemd-timesync = 154;
294+ liquidsoap = 155;
293295
294296 # When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
295297
nixos/modules/module-list.nix+1
@@ -89,6 +89,7 @@
8989 ./services/audio/alsa.nix
9090 # Disabled as fuppes it does no longer builds.
9191 # ./services/audio/fuppes.nix
92+ ./services/audio/liquidsoap.nix
9293 ./services/audio/mpd.nix
9394 ./services/audio/mopidy.nix
9495 ./services/backup/almir.nix
nixos/modules/services/audio/liquidsoap.nixnew file+74
@@ -0,0 +1,74 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ streams = builtins.attrNames config.services.liquidsoap.streams;
7+
8+ streamService =
9+ name:
10+ let stream = builtins.getAttr name config.services.liquidsoap.streams; in
11+ { inherit name;
12+ value = {
13+ after = [ "network-online.target" "sound.target" ];
14+ description = "${name} liquidsoap stream";
15+ wantedBy = [ "multi-user.target" ];
16+ path = [ pkgs.wget ];
17+ preStart =
18+ ''
19+ mkdir -p /var/log/liquidsoap
20+ chown liquidsoap -R /var/log/liquidsoap
21+ '';
22+ serviceConfig = {
23+ PermissionsStartOnly="true";
24+ ExecStart = "${pkgs.liquidsoap}/bin/liquidsoap ${stream}";
25+ User = "liquidsoap";
26+ };
27+ };
28+ };
29+in
30+{
31+
32+ ##### interface
33+
34+ options = {
35+
36+ services.liquidsoap.streams = mkOption {
37+
38+ description =
39+ ''
40+ Set of Liquidsoap streams to start,
41+ one systemd service per stream.
42+ '';
43+
44+ default = {};
45+
46+ example = {
47+ myStream1 = literalExample "\"/etc/liquidsoap/myStream1.liq\"";
48+ myStream2 = literalExample "./myStream2.liq";
49+ myStream3 = literalExample "\"out(playlist(\"/srv/music/\"))\"";
50+ };
51+
52+ type = types.attrsOf (types.either types.path types.str);
53+ };
54+
55+ };
56+ ##### implementation
57+
58+ config = mkIf (builtins.length streams != 0) {
59+
60+ users.extraUsers.liquidsoap = {
61+ uid = config.ids.uids.liquidsoap;
62+ group = "liquidsoap";
63+ extraGroups = [ "audio" ];
64+ description = "Liquidsoap streaming user";
65+ home = "/var/lib/liquidsoap";
66+ createHome = true;
67+ };
68+
69+ users.extraGroups.liquidsoap.gid = config.ids.gids.liquidsoap;
70+
71+ systemd.services = builtins.listToAttrs ( map streamService streams );
72+ };
73+
74+}
pkgs/servers/icecast/default.nix+10−10
@@ -1,28 +1,28 @@
11{stdenv, fetchurl
22, libxml2, libxslt, curl
3−, libvorbis, libtheora, speex, libkate }:
3+, libvorbis, libtheora, speex, libkate, libopus }:
44
55stdenv.mkDerivation rec {
6− name = "icecast-2.3.3";
6+ name = "icecast-2.4.0";
77
88 src = fetchurl {
99 url = "http://downloads.xiph.org/releases/icecast/${name}.tar.gz";
10− sha256 = "0vf38mk13z1czpbj0g8va4rzjf201slqmiwcs8y9i6iwz3shc78v";
10+ sha256 = "0chg8v3c0wkbakjcw73rsfccx13f28arrmmbz9p5fsmiw5bykdqp";
1111 };
1212
13− buildInputs = [ libxml2 libxslt curl libvorbis libtheora speex libkate ];
13+ buildInputs = [ libxml2 libxslt curl libvorbis libtheora speex libkate libopus ];
1414
1515 meta = {
1616 description = "Server software for streaming multimedia";
1717
1818 longDescription = ''
19− Icecast is a streaming media server which currently supports Ogg Vorbis and MP3
20− audio streams. It can be used to create an Internet radio station or a
21− privately running jukebox and many things in between. It is very versatile in
22− that new formats can be added relatively easily and supports open standards for
23− commuincation and interaction.
19+ Icecast is a streaming media server which currently supports
20+ Ogg (Vorbis and Theora), Opus, WebM and MP3 audio streams.
21+ It can be used to create an Internet radio station or a privately
22+ running jukebox and many things in between. It is very versatile
23+ in that new formats can be added relatively easily and supports
24+ open standards for commuincation and interaction.
2425 '';
25−
2626
2727 homepage = http://www.icecast.org;
2828 license = stdenv.lib.licenses.gpl2;
pkgs/tools/audio/liquidsoap/full.nixnew file+45
@@ -0,0 +1,45 @@
1+{ stdenv, fetchurl, which, pkgconfig
2+, ocaml, ocamlPackages
3+, libao, portaudio, alsaLib, pulseaudio, jack2
4+, libsamplerate, libmad, taglib, lame, libogg
5+, libvorbis, speex, libtheora, libopus, fdk_aac
6+, faad2, flac, ladspaH, ffmpeg, frei0r, dssi
7+, }:
8+
9+let
10+ version = "1.1.1";
11+
12+ packageFilters = map (p: "-e '/ocaml-${p}/d'" )
13+ [ "gstreamer" "shine" "aacplus" "schroedinger"
14+ "voaacenc" "soundtouch" "gavl" "lo"
15+ ];
16+in
17+stdenv.mkDerivation {
18+ name = "liquidsoap-full-${version}";
19+
20+ src = fetchurl {
21+ url = "mirror://sourceforge/project/savonet/liquidsoap/${version}/liquidsoap-${version}-full.tar.gz";
22+ sha256 = "1w1grgja5yibph90vsxj7ffkpz1sgzmr54jj52s8889dpy609wqa";
23+ };
24+
25+ preConfigure = "sed ${toString packageFilters} PACKAGES.default > PACKAGES";
26+ configureFlags = [ "--localstatedir=/var" ];
27+
28+ buildInputs =
29+ [ which ocaml ocamlPackages.findlib pkgconfig
30+ libao portaudio alsaLib pulseaudio jack2
31+ libsamplerate libmad taglib lame libogg
32+ libvorbis speex libtheora libopus fdk_aac
33+ faad2 flac ladspaH ffmpeg frei0r dssi
34+ ocamlPackages.xmlm ocamlPackages.ocaml_pcre
35+ ocamlPackages.camomile
36+ ];
37+
38+ meta = with stdenv.lib; {
39+ description = "Swiss-army knife for multimedia streaming";
40+ homepage = http://liquidsoap.fm/;
41+ maintainers = with maintainers; [ emery ];
42+ license = licenses.gpl2;
43+ platform = ocaml.meta.platforms;
44+ };
45+}
pkgs/top-level/all-packages.nix+2
@@ -1545,6 +1545,8 @@ let
15451545
15461546 less = callPackage ../tools/misc/less { };
15471547
1548+ liquidsoap = callPackage ../tools/audio/liquidsoap/full.nix { };
1549+
15481550 lockfileProgs = callPackage ../tools/misc/lockfile-progs { };
15491551
15501552 logstash = callPackage ../tools/misc/logstash { };