blob: efd4a7b5f0fb9bc51913e4d675ec402ada79f8b9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
{ config, lib, pkgs, ... }:
with lib;
let
phabricatorRoot = pkgs.phabricator;
in {
enablePHP = true;
extraApacheModules = [ "mod_rewrite" ];
DocumentRoot = "${phabricatorRoot}/phabricator/webroot";
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.";
};
};
extraConfig = ''
DocumentRoot ${phabricatorRoot}/phabricator/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
'';
extraServerPath = [
"${pkgs.which}"
"${pkgs.diffutils}"
] ++
(if config.mercurial then ["${pkgs.mercurial}"] else []) ++
(if config.subversion then ["${pkgs.subversion.out}"] else []) ++
(if config.git then ["${pkgs.git}"] else []);
startupScript = pkgs.writeScript "activatePhabricator" ''
mkdir -p /var/repo
chown wwwrun /var/repo
'';
}
|