2018-09-09 12:10:04 +02:00
|
|
|
{ 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" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
User = "lidarr";
|
|
|
|
Group = "lidarr";
|
|
|
|
ExecStart = "${pkgs.lidarr}/bin/Lidarr";
|
|
|
|
Restart = "on-failure";
|
|
|
|
|
2019-02-24 18:36:50 +01:00
|
|
|
StateDirectory = "lidarr";
|
2018-09-09 12:10:04 +02:00
|
|
|
StateDirectoryMode = "0770";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.lidarr = {
|
|
|
|
uid = config.ids.uids.lidarr;
|
|
|
|
home = "/var/lib/lidarr";
|
|
|
|
group = "lidarr";
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups.lidarr.gid = config.ids.gids.lidarr;
|
|
|
|
};
|
|
|
|
}
|