about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/http/apache-modules/mod_cspnonce/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/http/apache-modules/mod_cspnonce/default.nix')
-rw-r--r--nixpkgs/pkgs/servers/http/apache-modules/mod_cspnonce/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/http/apache-modules/mod_cspnonce/default.nix b/nixpkgs/pkgs/servers/http/apache-modules/mod_cspnonce/default.nix
new file mode 100644
index 000000000000..f6de7f017537
--- /dev/null
+++ b/nixpkgs/pkgs/servers/http/apache-modules/mod_cspnonce/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchFromGitHub, apacheHttpd }:
+
+stdenv.mkDerivation rec {
+  pname = "mod_cspnonce";
+  version = "1.4";
+
+  src = fetchFromGitHub {
+    owner = "wyattoday";
+    repo = "mod_cspnonce";
+    rev = version;
+    hash = "sha256-uUWRKUjS2LvHgT5xrK+LZLQRHc6wMaxGca2OsVxVlRs=";
+  };
+
+  buildInputs = [ apacheHttpd ];
+
+  buildPhase = ''
+    apxs -ca mod_cspnonce.c
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/modules
+    cp .libs/mod_cspnonce.so $out/modules
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "An Apache2 module that makes it dead simple to add nonce values to the CSP";
+    homepage = "https://github.com/wyattoday/mod_cspnonce";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ dasj19 ];
+  };
+}