commit
b462bd1960
@ -162,6 +162,7 @@
|
|||||||
systemd-network = 152;
|
systemd-network = 152;
|
||||||
systemd-resolve = 153;
|
systemd-resolve = 153;
|
||||||
systemd-timesync = 154;
|
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!
|
# 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-network = 152;
|
||||||
systemd-resolve = 153;
|
systemd-resolve = 153;
|
||||||
systemd-timesync = 154;
|
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!
|
# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@
|
|||||||
./services/audio/alsa.nix
|
./services/audio/alsa.nix
|
||||||
# Disabled as fuppes it does no longer builds.
|
# Disabled as fuppes it does no longer builds.
|
||||||
# ./services/audio/fuppes.nix
|
# ./services/audio/fuppes.nix
|
||||||
|
./services/audio/liquidsoap.nix
|
||||||
./services/audio/mpd.nix
|
./services/audio/mpd.nix
|
||||||
./services/audio/mopidy.nix
|
./services/audio/mopidy.nix
|
||||||
./services/backup/almir.nix
|
./services/backup/almir.nix
|
||||||
|
74
nixos/modules/services/audio/liquidsoap.nix
Normal file
74
nixos/modules/services/audio/liquidsoap.nix
Normal 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 );
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -1,29 +1,29 @@
|
|||||||
{stdenv, fetchurl
|
{stdenv, fetchurl
|
||||||
, libxml2, libxslt, curl
|
, libxml2, libxslt, curl
|
||||||
, libvorbis, libtheora, speex, libkate }:
|
, libvorbis, libtheora, speex, libkate, libopus }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "icecast-2.3.3";
|
name = "icecast-2.4.0";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://downloads.xiph.org/releases/icecast/${name}.tar.gz";
|
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 = {
|
meta = {
|
||||||
description = "Server software for streaming multimedia";
|
description = "Server software for streaming multimedia";
|
||||||
|
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
Icecast is a streaming media server which currently supports Ogg Vorbis and MP3
|
Icecast is a streaming media server which currently supports
|
||||||
audio streams. It can be used to create an Internet radio station or a
|
Ogg (Vorbis and Theora), Opus, WebM and MP3 audio streams.
|
||||||
privately running jukebox and many things in between. It is very versatile in
|
It can be used to create an Internet radio station or a privately
|
||||||
that new formats can be added relatively easily and supports open standards for
|
running jukebox and many things in between. It is very versatile
|
||||||
commuincation and interaction.
|
in that new formats can be added relatively easily and supports
|
||||||
|
open standards for commuincation and interaction.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
homepage = http://www.icecast.org;
|
homepage = http://www.icecast.org;
|
||||||
license = stdenv.lib.licenses.gpl2;
|
license = stdenv.lib.licenses.gpl2;
|
||||||
maintainers = with stdenv.lib.maintainers; [ jcumming ];
|
maintainers = with stdenv.lib.maintainers; [ jcumming ];
|
||||||
|
45
pkgs/tools/audio/liquidsoap/full.nix
Normal file
45
pkgs/tools/audio/liquidsoap/full.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
@ -1545,6 +1545,8 @@ let
|
|||||||
|
|
||||||
less = callPackage ../tools/misc/less { };
|
less = callPackage ../tools/misc/less { };
|
||||||
|
|
||||||
|
liquidsoap = callPackage ../tools/audio/liquidsoap/full.nix { };
|
||||||
|
|
||||||
lockfileProgs = callPackage ../tools/misc/lockfile-progs { };
|
lockfileProgs = callPackage ../tools/misc/lockfile-progs { };
|
||||||
|
|
||||||
logstash = callPackage ../tools/misc/logstash { };
|
logstash = callPackage ../tools/misc/logstash { };
|
||||||
|
Loading…
Reference in New Issue
Block a user