1 { config, lib, pkgs, ... }:
6 cfg = config.services.beanstalkd;
14 services.beanstalkd = {
15 enable = mkEnableOption (lib.mdDoc "the Beanstalk work queue");
20 description = lib.mdDoc "TCP port that will be used to accept client connections.";
26 description = lib.mdDoc "IP address to listen on.";
27 default = "127.0.0.1";
32 openFirewall = mkOption {
35 description = lib.mdDoc "Whether to open ports in the firewall for the server.";
42 config = mkIf cfg.enable {
44 networking.firewall = mkIf cfg.openFirewall {
45 allowedTCPPorts = [ cfg.listen.port ];
48 environment.systemPackages = [ pkg ];
50 systemd.services.beanstalkd = {
51 description = "Beanstalk Work Queue";
52 after = [ "network.target" ];
53 wantedBy = [ "multi-user.target" ];
57 ExecStart = "${pkg}/bin/beanstalkd -l ${cfg.listen.address} -p ${toString cfg.listen.port} -b $STATE_DIRECTORY";
58 StateDirectory = "beanstalkd";