2017-01-16 11:53:53 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.couchpotato;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.couchpotato = {
|
|
|
|
enable = mkEnableOption "CouchPotato Server";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.couchpotato = {
|
|
|
|
description = "CouchPotato Server";
|
|
|
|
after = [ "network.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
User = "couchpotato";
|
|
|
|
Group = "couchpotato";
|
2019-02-23 21:11:22 +00:00
|
|
|
StateDirectory = "couchpotato";
|
2017-01-16 11:53:53 +00:00
|
|
|
ExecStart = "${pkgs.couchpotato}/bin/couchpotato";
|
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-09-14 18:51:29 +01:00
|
|
|
users.users.couchpotato =
|
|
|
|
{ group = "couchpotato";
|
2017-01-16 11:53:53 +00:00
|
|
|
home = "/var/lib/couchpotato/";
|
|
|
|
description = "CouchPotato daemon user";
|
|
|
|
uid = config.ids.uids.couchpotato;
|
|
|
|
};
|
|
|
|
|
2019-09-14 18:51:29 +01:00
|
|
|
users.groups.couchpotato =
|
|
|
|
{ gid = config.ids.gids.couchpotato; };
|
2017-01-16 11:53:53 +00:00
|
|
|
};
|
|
|
|
}
|