diff options
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/web-servers/fcgiwrap.nix | 49 |
2 files changed, 50 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index c1b55cb5550e..7fa705a5ae37 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -255,6 +255,7 @@ ./services/ttys/agetty.nix ./services/ttys/kmscon.nix ./services/web-servers/apache-httpd/default.nix + ./services/web-servers/fcgiwrap.nix ./services/web-servers/jboss/default.nix ./services/web-servers/lighttpd/default.nix ./services/web-servers/lighttpd/cgit.nix diff --git a/nixos/modules/services/web-servers/fcgiwrap.nix b/nixos/modules/services/web-servers/fcgiwrap.nix new file mode 100644 index 000000000000..7e91e7b60eef --- /dev/null +++ b/nixos/modules/services/web-servers/fcgiwrap.nix @@ -0,0 +1,49 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.fcgiwrap; + +in { + + options = { + services.fcgiwrap = { + enable = mkOption { + type = types.bool; + default = false; + description = "Whether to enable fcgiwrap, a server for running CGI applications over FastCGI."; + }; + + preforkProcesses = mkOption { + type = types.int; + default = 1; + description = "Number of processes to prefork."; + }; + + bindSocket = mkOption { + type = types.string; + default = "unix:/run/fcgiwrap.sock"; + description = '' + Socket to bind to. Valid socket URLs are: + unix:/path/to/socket for Unix sockets + tcp:dot.ted.qu.ad:port for IPv4 sockets + tcp6:[ipv6_addr]:port for IPv6 sockets + ''; + }; + }; + }; + + config = mkIf cfg.enable { + + systemd.services.fcgiwrap = { + after = [ "nss-user-lookup.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = "${pkgs.fcgiwrap}/sbin/fcgiwrap -c ${builtins.toString cfg.preforkProcesses} -s ${cfg.bindSocket}"; + }; + }; + + }; +} |