radarr: init at 0.2.0.553 + nixos module

This commit is contained in:
Edward Tjörnhammar 2017-03-25 21:18:34 +01:00
parent 2db5c5cfe2
commit b35d22b30c
No known key found for this signature in database
GPG Key ID: 7B82CE4A866B6845
4 changed files with 78 additions and 0 deletions

View File

@ -296,6 +296,7 @@
./services/misc/parsoid.nix ./services/misc/parsoid.nix
./services/misc/phd.nix ./services/misc/phd.nix
./services/misc/plex.nix ./services/misc/plex.nix
./services/misc/radarr.nix
./services/misc/redmine.nix ./services/misc/redmine.nix
./services/misc/rippled.nix ./services/misc/rippled.nix
./services/misc/ripple-rest.nix ./services/misc/ripple-rest.nix

View File

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

View File

@ -0,0 +1,31 @@
{ stdenv, fetchurl, mono, libmediainfo, sqlite, makeWrapper }:
stdenv.mkDerivation rec {
name = "radarr-${version}";
version = "0.2.0.535";
src = fetchurl {
url = "https://github.com/Radarr/Radarr/releases/download/v${version}/Radarr.develop.${version}.linux.tar.gz";
sha256 = "1ccvblklqn5iki7gc16bzzbwms28mv4kxzv1nwhlm9vf0cw4qxbr";
};
buildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/{bin,share/${name}}
cp -r * $out/share/${name}/.
makeWrapper "${mono}/bin/mono" $out/bin/Radarr \
--add-flags "$out/share/${name}/Radarr.exe" \
--prefix LD_LIBRARY_PATH ':' "${sqlite.out}/lib" \
--prefix LD_LIBRARY_PATH ':' "${libmediainfo}/lib"
'';
meta = with stdenv.lib; {
description = "A Usenet/BitTorrent movie downloader.";
homepage = https://radarr.video/;
license = licenses.gpl3;
maintainers = with maintainers; [ edwtjo ];
platforms = platforms.all;
};
}

View File

@ -3670,6 +3670,8 @@ with pkgs;
radamsa = callPackage ../tools/security/radamsa { }; radamsa = callPackage ../tools/security/radamsa { };
radarr = callPackage ../servers/radarr { };
radvd = callPackage ../tools/networking/radvd { }; radvd = callPackage ../tools/networking/radvd { };
rambox = callPackage ../applications/networking/instant-messengers/rambox { }; rambox = callPackage ../applications/networking/instant-messengers/rambox { };