summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/fcgiwrap.nix
diff options
context:
space:
mode:
authorLuca Bruno <lethalman88@gmail.com>2014-05-10 18:37:58 +0200
committerLuca Bruno <lethalman88@gmail.com>2014-06-04 10:20:19 +0200
commit12f06b3cc3f57a18cb285fd2274292faa6eb038d (patch)
treed791e9d00a25ce09201593abffc2660c2c153f2f /nixos/modules/services/web-servers/fcgiwrap.nix
parentda55068a8d03bf743a0645afcc77d124072c4f2a (diff)
downloadnixlib-12f06b3cc3f57a18cb285fd2274292faa6eb038d.tar
nixlib-12f06b3cc3f57a18cb285fd2274292faa6eb038d.tar.gz
nixlib-12f06b3cc3f57a18cb285fd2274292faa6eb038d.tar.bz2
nixlib-12f06b3cc3f57a18cb285fd2274292faa6eb038d.tar.lz
nixlib-12f06b3cc3f57a18cb285fd2274292faa6eb038d.tar.xz
nixlib-12f06b3cc3f57a18cb285fd2274292faa6eb038d.tar.zst
nixlib-12f06b3cc3f57a18cb285fd2274292faa6eb038d.zip
fcgiwrap: new package
Simple server for running CGI applications over FastCGI

https://nginx.localdomain.pl/wiki/FcgiWrap
Diffstat (limited to 'nixos/modules/services/web-servers/fcgiwrap.nix')
-rw-r--r--nixos/modules/services/web-servers/fcgiwrap.nix49
1 files changed, 49 insertions, 0 deletions
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}";
+      };
+    };
+
+  };
+}