about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2018-09-08 17:24:58 +0200
committerGitHub <noreply@github.com>2018-09-08 17:24:58 +0200
commitb58a230c60c31effd8eac43cb3a88d172ee19b71 (patch)
tree7f67c38d2a752c84f78d7db8c7b96da43968a1c7 /pkgs/servers
parent0ce6e32cb78e3fc812427936ac37671795c71c5b (diff)
parent53ef5441bb261bcb52b5ffe7cab77ba46114e7e9 (diff)
downloadnixlib-b58a230c60c31effd8eac43cb3a88d172ee19b71.tar
nixlib-b58a230c60c31effd8eac43cb3a88d172ee19b71.tar.gz
nixlib-b58a230c60c31effd8eac43cb3a88d172ee19b71.tar.bz2
nixlib-b58a230c60c31effd8eac43cb3a88d172ee19b71.tar.lz
nixlib-b58a230c60c31effd8eac43cb3a88d172ee19b71.tar.xz
nixlib-b58a230c60c31effd8eac43cb3a88d172ee19b71.tar.zst
nixlib-b58a230c60c31effd8eac43cb3a88d172ee19b71.zip
Merge pull request #46370 from primeos/nixos-sks
sks,nixos/sks: Various minor improvements

Module:
- Add a webroot option (serve a website by default, makes the setup easier)
- Explicitly set a group (instead of using 65534/nogroup)
- Move pkgs.sks from environment.systemPackages to the "sks" user and add pkgs.db

Package:
- Adapt the output of "sks version" to NixOS
- Copy the example webpages to $webSamples
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/sks/adapt-to-nixos.patch27
-rw-r--r--pkgs/servers/sks/default.nix8
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/servers/sks/adapt-to-nixos.patch b/pkgs/servers/sks/adapt-to-nixos.patch
new file mode 100644
index 000000000000..b4403e8c7bc7
--- /dev/null
+++ b/pkgs/servers/sks/adapt-to-nixos.patch
@@ -0,0 +1,27 @@
+--- a/version.ml	2018-09-08 15:56:18.919154257 +0200
++++ b/version.ml	2018-09-08 15:56:07.544028575 +0200
+@@ -24,16 +24,6 @@
+ 
+ let run () =
+   let bdb_version = Bdb.version () in
+-  let dbstats_dir =
+-    let split = Str.regexp_string "." in
+-    let major_minor_string major minor =
+-      sprintf "Further details about the BDB environment can be seen by \
+-	  executing\ndb%s.%s_stat -x in the KDB and Ptree directories\n" major minor
+-    in
+-    match Str.split split bdb_version with
+-    | major :: minor :: _ -> major_minor_string major minor
+-    | [] | _ :: []        -> major_minor_string "X"   "Y"
+-  in
+   printf "SKS version %s%s\n"
+     Common.version Common.version_suffix;
+ 	
+@@ -44,5 +34,6 @@
+          requirement for recon of SKS %s\n"
+       Common.compatible_version_string;
+ 	
+-  printf "%s" dbstats_dir
++  printf "Further details about the BDB environment can be seen by executing\n\
++    db_stat -x in the KDB and PTree directories\n"
+ 
diff --git a/pkgs/servers/sks/default.nix b/pkgs/servers/sks/default.nix
index fe4029db1c14..deeeabda7451 100644
--- a/pkgs/servers/sks/default.nix
+++ b/pkgs/servers/sks/default.nix
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
     sha256 = "00q5ma5rvl10rkc6cdw8d69bddgrmvy0ckqj3hbisy65l4idj2zm";
   };
 
+  # pkgs.db provides db_stat, not db$major.$minor_stat
+  patches = [ ./adapt-to-nixos.patch ];
+
+  outputs = [ "out" "webSamples" ];
+
   buildInputs = [ ocaml zlib db perl camlp4 ];
 
   makeFlags = [ "PREFIX=$(out)" "MANDIR=$(out)/share/man" ];
@@ -26,6 +31,9 @@ stdenv.mkDerivation rec {
   doCheck = true;
   checkPhase = "./sks unit_test";
 
+  # Copy the web examples for the NixOS module
+  postInstall = "cp -R sampleWeb $webSamples";
+
   meta = with stdenv.lib; {
     description = "An easily deployable & decentralized OpenPGP keyserver";
     longDescription = ''