summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/limesurvey
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2015-02-07 21:20:53 +0100
committerJaka Hudoklin <jakahudoklin@gmail.com>2015-02-07 23:18:51 +0100
commit41ae4d1af9a2273a1925cfe755989ee7f76e8adb (patch)
treeccf112c14a8e68974b27d11eb0b9599115ace985 /pkgs/servers/limesurvey
parenta6a9d8137f5e08c33c270a7fb38a0ed55860fedf (diff)
add limesurvey package and nixos module
Diffstat (limited to 'pkgs/servers/limesurvey')
-rw-r--r--pkgs/servers/limesurvey/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/servers/limesurvey/default.nix b/pkgs/servers/limesurvey/default.nix
new file mode 100644
index 000000000000..89ce5a644d80
--- /dev/null
+++ b/pkgs/servers/limesurvey/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchFromGitHub, writeText, makeWrapper, php }:
+
+stdenv.mkDerivation rec {
+ name = "limesurvey-${version}";
+ version = "2.05_plus_141210";
+
+ src = fetchFromGitHub {
+ owner = "LimeSurvey";
+ repo = "LimeSurvey";
+ rev = version;
+ sha256 = "1b5yixrlrjm055ag07c7phk84mk1892v20nsss1y0xzvgn6s14gq";
+ };
+
+ buildInputs = [ makeWrapper ];
+
+ phpConfig = writeText "config.php" ''
+ <?php
+ return require(getenv('LIMESURVEY_CONFIG'));
+ ?>
+ '';
+
+ patchPhase = ''
+ substituteInPlace application/core/LSYii_Application.php \
+ --replace "'basePath" "//'basePath"
+ '';
+
+ installPhase = ''
+ mkdir -p $out/{bin,share/limesurvey}
+ cp -R . $out/share/limesurvey
+ cp ${phpConfig} $out/share/limesurvey/application/config/config.php
+ makeWrapper ${php}/bin/php $out/bin/limesurvey-console \
+ --add-flags "$out/share/limesurvey/application/commands/console.php"
+ '';
+
+ meta = with lib; {
+ description = "Open source survey application";
+ license = licenses.gpl2;
+ homepage = https://www.limesurvey.org;
+ maintainers = with maintainers; [offline];
+ };
+}