nixpkgs-suyu/nixos/modules/services/misc/couchpotato.nix

43 lines
927 B
Nix
Raw Normal View History

2017-01-16 12:53:53 +01: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";
StateDirectory = "couchpotato";
2017-01-16 12:53:53 +01:00
ExecStart = "${pkgs.couchpotato}/bin/couchpotato";
Restart = "on-failure";
};
};
users.users.couchpotato =
{ group = "couchpotato";
2017-01-16 12:53:53 +01:00
home = "/var/lib/couchpotato/";
description = "CouchPotato daemon user";
uid = config.ids.uids.couchpotato;
};
users.groups.couchpotato =
{ gid = config.ids.gids.couchpotato; };
2017-01-16 12:53:53 +01:00
};
}