Merge pull request #15957 from mayflower/sonarr_upstream

sonarr: init at 2.0.0.4146 + sonarr service
This commit is contained in:
Robin Gloster 2016-07-15 17:34:18 +02:00 committed by GitHub
commit 0749876016
4 changed files with 80 additions and 0 deletions

View File

@ -258,6 +258,7 @@
./services/misc/ripple-data-api.nix
./services/misc/rogue.nix
./services/misc/siproxd.nix
./services/misc/sonarr.nix
./services/misc/spice-vdagentd.nix
./services/misc/subsonic.nix
./services/misc/sundtek.nix

View File

@ -0,0 +1,44 @@
{ config, pkgs, lib, mono, ... }:
with lib;
let
cfg = config.services.sonarr;
in
{
options = {
services.sonarr = {
enable = mkEnableOption "Sonarr";
};
};
config = mkIf cfg.enable {
systemd.services.sonarr = {
description = "Sonarr";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
test -d /var/lib/sonarr/ || {
echo "Creating sonarr data directory in /var/lib/sonarr/"
mkdir -p /var/lib/sonarr/
}
chown -R sonarr /var/lib/sonarr/
chmod 0700 /var/lib/sonarr/
'';
serviceConfig = {
Type = "simple";
User = "sonarr";
Group = "nogroup";
PermissionsStartOnly = "true";
ExecStart = "${pkgs.sonarr}/bin/NzbDrone --no-browser";
Restart = "on-failure";
};
};
users.extraUsers.sonarr = {
home = "/var/lib/sonarr";
};
};
}

View File

@ -0,0 +1,33 @@
{ stdenv, fetchurl, mono, libmediainfo, sqlite, makeWrapper, ... }:
stdenv.mkDerivation rec {
name = "sonarr-${version}";
version = "2.0.0.4230";
src = fetchurl {
url = "http://download.sonarr.tv/v2/master/mono/NzbDrone.master.${version}.mono.tar.gz";
sha256 = "16nx0v5hpqlwna2hzpcpzvm7qc361yjxbqnwz5bfnnkb0h7ik5m6";
};
buildInputs = [
makeWrapper
];
installPhase = ''
mkdir -p $out/bin
cp -r * $out/bin/
makeWrapper "${mono}/bin/mono" $out/bin/NzbDrone \
--add-flags "$out/bin/NzbDrone.exe" \
--prefix LD_LIBRARY_PATH ':' "${sqlite.out}/lib" \
--prefix LD_LIBRARY_PATH ':' "${libmediainfo}/lib"
'';
meta = {
description = "Smart PVR for newsgroup and bittorrent users";
homepage = https://sonarr.tv/;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.fadenb ];
platforms = stdenv.lib.platforms.all;
};
}

View File

@ -3474,6 +3474,8 @@ in
solvespace = callPackage ../applications/graphics/solvespace { };
sonarr = callPackage ../servers/sonarr { };
sonata = callPackage ../applications/audio/sonata {
inherit (python3Packages) buildPythonApplication python isPy3k dbus pygobject3 mpd2;
};