0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

lidarr: init at 0.3.1.471

Fork of sonarr (as radarr) but for music instead of series and movies.
This commit is contained in:
Elis Hirwing 2018-09-09 12:10:04 +02:00 committed by Edward Tjörnhammar
parent 18db34f09b
commit aba95986d2
No known key found for this signature in database
GPG key ID: 577898458385603E
5 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.services.lidarr;
in
{
options = {
services.lidarr = {
enable = mkEnableOption "Lidarr";
};
};
config = mkIf cfg.enable {
systemd.services.lidarr = {
description = "Lidarr";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
[ ! -d /var/lib/lidarr ] && mkdir -p /var/lib/lidarr
chown -R lidarr:lidarr /var/lib/lidarr
'';
serviceConfig = {
Type = "simple";
User = "lidarr";
Group = "lidarr";
PermissionsStartOnly = "true";
ExecStart = "${pkgs.lidarr}/bin/Lidarr";
Restart = "on-failure";
StateDirectory = "/var/lib/lidarr/";
StateDirectoryMode = "0770";
};
};
users.users.lidarr = {
uid = config.ids.uids.lidarr;
home = "/var/lib/lidarr";
group = "lidarr";
};
users.groups.lidarr.gid = config.ids.gids.lidarr;
};
}