roon-server: init at 100600401

This commit is contained in:
Steve Elliott 2019-06-21 14:58:20 -04:00
parent 463bd416f0
commit 725e2793dd
4 changed files with 117 additions and 0 deletions

View file

@ -190,6 +190,7 @@
./services/audio/liquidsoap.nix ./services/audio/liquidsoap.nix
./services/audio/mpd.nix ./services/audio/mpd.nix
./services/audio/mopidy.nix ./services/audio/mopidy.nix
./services/audio/roon-server.nix
./services/audio/slimserver.nix ./services/audio/slimserver.nix
./services/audio/snapserver.nix ./services/audio/snapserver.nix
./services/audio/squeezelite.nix ./services/audio/squeezelite.nix

View file

@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
with lib;
let
name = "roon-server";
cfg = config.services.roon-server;
in {
options = {
services.roon-server = {
enable = mkEnableOption "Roon Server";
openFirewall = mkOption {
type = types.bool;
default = false;
description = ''
Open ports in the firewall for the server.
UDP: 9003
TCP: 9100 - 9200
'';
};
};
};
config = mkIf cfg.enable {
systemd.services.roon-server = {
after = [ "network.target" ];
description = "Roon Server";
wantedBy = [ "multi-user.target" ];
environment.ROON_DATAROOT = "/var/lib/${name}";
serviceConfig = {
ExecStart = "${pkgs.roon-server}/opt/start.sh";
LimitNOFILE = 8192;
DynamicUser = true;
SupplementaryGroups = "audio";
StateDirectory = name;
};
};
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPortRanges = [
{ from = 9100; to = 9200; }
];
allowedUDPPorts = [ 9003 ];
};
};
}

View file

@ -0,0 +1,65 @@
{ alsaLib, alsaUtils, cifs-utils, fetchurl, ffmpeg, libav, mono, stdenv }:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "roon-server";
version = "100600401";
src = fetchurl {
url = "http://download.roonlabs.com/updates/stable/RoonServer_linuxx64_${version}.tar.bz2";
sha256 = "121mmdh35q4bpgsqhcps6a6q1f4ld9v4hq9gp181bf2n779pk8sh";
};
installPhase = ''
runHook preInstall
# Check script
sed -i '3i PATH=$PATH:${makeBinPath [ cifs-utils ffmpeg libav ]}' check.sh
sed -i '/check_ulimit$/d' check.sh
# Start script
sed -i '3i PATH=$PATH:${makeBinPath [ alsaUtils cifs-utils ffmpeg libav ]}' start.sh
# Debug logging
sed -i '/--debug--gc=sgen --server/exec "$HARDLINK" --debug --gc=sgen --server "$SCRIPT.exe" "$@" -storagetrace -watchertrace' Appliance/RoonAppliance
# Binaries
sed -i '/# boost ulimit/,+2 d' Appliance/RAATServer
sed -i '/# boost ulimit/,+2 d' Appliance/RoonAppliance
sed -i '/# boost ulimit/,+2 d' Server/RoonServer
sed -i '/ln -sf/ d' Appliance/RAATServer
sed -i '/ln -sf/ d' Appliance/RoonAppliance
sed -i '/ln -sf/ d' Server/RoonServer
mkdir -p $out/opt
mv * $out/opt
ln -sf $out/opt/RoonMono/bin/mono-sgen $out/opt/RoonMono/bin/RoonServer
ln -sf $out/opt/RoonMono/bin/mono-sgen $out/opt/RoonMono/bin/RoonAppliance
ln -sf $out/opt/RoonMono/bin/mono-sgen $out/opt/RoonMono/bin/RAATServer
runHook postInstall
'';
preFixup = ''
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${alsaLib}/lib" \
$out/opt/RoonMono/bin/mono-sgen
# Checkers
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${alsaLib}/lib" \
$out/opt/Appliance/check_alsa
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/opt/Appliance/check_bincompat
'';
meta = {
description = "The music player for music lovers.";
homepage = https://roonlabs.com;
license = licenses.unfree;
maintainers = with maintainers; [ steell ];
platforms = platforms.linux;
};
}

View file

@ -14715,6 +14715,8 @@ in
}; };
}; };
roon-server = callPackage ../servers/roon-server { };
s6 = skawarePackages.s6; s6 = skawarePackages.s6;
s6-rc = skawarePackages.s6-rc; s6-rc = skawarePackages.s6-rc;