3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/modules/services/networking/sabnzbd.nix
Wouter den Breejen e058f7ea45 sabnzbd now really starts at boot
svn path=/nixos/trunk/; revision=22579
2010-07-13 14:45:44 +00:00

53 lines
971 B
Nix

{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.services.sabnzbd;
inherit (pkgs) sabnzbd;
in
{
###### interface
options = {
services.sabnzbd = {
enable = mkOption {
default = false;
description = "Whether to enable the sabnzbd FTP server.";
};
configFile = mkOption {
default = "/var/sabnzbd/sabnzbd.ini";
description = "Path to config file. (You need to create this file yourself!)";
};
};
};
###### implementation
config = mkIf cfg.enable {
users.extraUsers =
[ { name = "sabnzbd";
uid = config.ids.uids.sabnzbd;
description = "sabnzbd user";
home = "/homeless-shelter";
}
];
jobs.sabnzbd =
{ description = "sabnzbd server";
startOn = "started network-interfaces";
stopOn = "stopping network-interfaces";
exec = "${sabnzbd}/bin/sabnzbd -d -f ${cfg.configFile}";
};
};
}