2014-05-12 19:59:40 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2014-07-17 12:51:17 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2014-05-12 19:59:40 +02:00
|
|
|
let
|
2014-07-17 12:51:17 +02:00
|
|
|
phabricatorRoot = pkgs.phabricator;
|
2014-05-12 19:59:40 +02:00
|
|
|
in {
|
2014-07-17 12:51:17 +02:00
|
|
|
|
2014-05-12 19:59:40 +02:00
|
|
|
enablePHP = true;
|
|
|
|
extraApacheModules = [ "mod_rewrite" ];
|
|
|
|
DocumentRoot = "${phabricatorRoot}/phabricator/webroot";
|
2014-07-17 12:51:17 +02:00
|
|
|
|
|
|
|
options = {
|
|
|
|
git = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = "Enable git repositories.";
|
|
|
|
};
|
|
|
|
mercurial = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = "Enable mercurial repositories.";
|
|
|
|
};
|
|
|
|
subversion = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = "Enable subversion repositories.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2014-05-12 19:59:40 +02:00
|
|
|
extraConfig = ''
|
|
|
|
DocumentRoot ${phabricatorRoot}/phabricator/webroot
|
|
|
|
|
|
|
|
RewriteEngine on
|
|
|
|
RewriteRule ^/rsrc/(.*) - [L,QSA]
|
|
|
|
RewriteRule ^/favicon.ico - [L,QSA]
|
|
|
|
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
|
|
|
|
'';
|
2014-07-17 12:51:17 +02:00
|
|
|
|
|
|
|
extraServerPath = [
|
|
|
|
"${pkgs.which}"
|
|
|
|
"${pkgs.diffutils}"
|
|
|
|
] ++
|
|
|
|
(if config.mercurial then ["${pkgs.mercurial}"] else []) ++
|
2015-10-26 11:30:48 +01:00
|
|
|
(if config.subversion then ["${pkgs.subversion.out}"] else []) ++
|
2014-07-17 12:51:17 +02:00
|
|
|
(if config.git then ["${pkgs.git}"] else []);
|
|
|
|
|
|
|
|
startupScript = pkgs.writeScript "activatePhabricator" ''
|
|
|
|
mkdir -p /var/repo
|
|
|
|
chown wwwrun /var/repo
|
|
|
|
'';
|
|
|
|
|
2014-05-12 19:59:40 +02:00
|
|
|
}
|