Merge pull request #63551 from Steell/roon-server

roon-server: init at 100600401
This commit is contained in:
Peter Hoeg 2019-07-02 10:06:29 +08:00 committed by GitHub
commit 10dd03e0a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 122 additions and 0 deletions

View file

@ -4851,6 +4851,11 @@
github = "severen";
name = "Severen Redwood";
};
steell = {
email = "steve@steellworks.com";
github = "Steell";
name = "Steve Elliott";
};
stephenmw = {
email = "stephen@q5comm.com";
github = "stephenmw";

View file

@ -191,6 +191,7 @@
./services/audio/liquidsoap.nix
./services/audio/mpd.nix
./services/audio/mopidy.nix
./services/audio/roon-server.nix
./services/audio/slimserver.nix
./services/audio/snapserver.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

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