Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sickrage: nixos module #46340

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -393,6 +393,7 @@
./services/misc/serviio.nix
./services/misc/safeeyes.nix
./services/misc/siproxd.nix
./services/misc/sickrage.nix
./services/misc/snapper.nix
./services/misc/sonarr.nix
./services/misc/spice-vdagentd.nix
Expand Down
48 changes: 48 additions & 0 deletions nixos/modules/services/misc/sickrage.nix
@@ -0,0 +1,48 @@
{config, pkgs, lib, ...}:

with lib;

let cfg = config.services.sickrage;
in {
options.services.sickrage = {
enable = mkOption {
description = "Activate Sickrage server";
type = types.bool;
visible = true;
default = false;
};
port = mkOption {
description = "Sickrage's listening port";
type = types.int;
visible = true;
default = 8001;
};
};


config = mkIf cfg.enable {
systemd.services.sickrage = {
enable = true;
after = ["network.target"];
description = "Sickrage server";
serviceConfig = {
Type = "forking";
User = "sickrage";
Group = "nogroup";
RuntimeDirectory = "sickrage";
StateDirectory = "sickrage";
PIDFile = "/run/sickrage/sickrage.pid";
ExecStart = "/nix/store/niz2pzmfs0f0wkg64lbdrn2h8q7gzkyj-sickrage-v2018.07.18-2/SickBeard.py --daemon --datadir=/var/lib/sickrage --pidfile=/run/sickrage/sickrage.pid --port=${toString cfg.port}";
};
wantedBy = ["multi-user.target"];
};
users = {
users = {
sickrage = {
isSystemUser = true;
name = "sickrage";
};
};
};
};
}