2018-09-09 11:10:04 +01: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 17:36:50 +00:00
|
|
|
StateDirectory = "lidarr";
|
2018-09-09 11:10:04 +01: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;
|
|
|
|
};
|
|
|
|
}
|