Enabled access to binaries of needed tools, and worker daemons can be enabled for phabricator #3306

authored by Strahinja Popovic and committed by Michael Raskin fe3f7716 dae0d770

+125 -26
+1
nixos/modules/module-list.nix
··· 165 ./services/misc/nix-gc.nix 166 ./services/misc/nixos-manual.nix 167 ./services/misc/nix-ssh-serve.nix 168 ./services/misc/rippled.nix 169 ./services/misc/rogue.nix 170 ./services/misc/siproxd.nix
··· 165 ./services/misc/nix-gc.nix 166 ./services/misc/nixos-manual.nix 167 ./services/misc/nix-ssh-serve.nix 168 + ./services/misc/phd.nix 169 ./services/misc/rippled.nix 170 ./services/misc/rogue.nix 171 ./services/misc/siproxd.nix
+52
nixos/modules/services/misc/phd.nix
···
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + 7 + cfg = config.services.phd; 8 + 9 + in 10 + 11 + { 12 + 13 + ###### interface 14 + 15 + options = { 16 + 17 + services.phd = { 18 + 19 + enable = mkOption { 20 + default = false; 21 + description = " 22 + Enable daemons for phabricator. 23 + "; 24 + }; 25 + 26 + }; 27 + 28 + }; 29 + 30 + ###### implementation 31 + 32 + config = mkIf cfg.enable { 33 + 34 + systemd.services.phd = { 35 + path = [ pkgs.phabricator pkgs.php pkgs.mercurial pkgs.git pkgs.subversion ]; 36 + 37 + after = [ "httpd.service" ]; 38 + wantedBy = [ "multi-user.target" ]; 39 + 40 + serviceConfig = { 41 + ExecStart = "${pkgs.phabricator}/phabricator/bin/phd start"; 42 + ExecStop = "${pkgs.phabricator}/phabricator/bin/phd start"; 43 + User = "wwwrun"; 44 + RestartSec = "30s"; 45 + Restart = "always"; 46 + StartLimitInterval = "1m"; 47 + }; 48 + }; 49 + 50 + }; 51 + 52 + }
+35 -26
nixos/modules/services/web-servers/apache-httpd/phabricator.nix
··· 1 { config, lib, pkgs, ... }: 2 let 3 - phabricatorRoot = pkgs.stdenv.mkDerivation rec { 4 - version = "2014-05-12"; 5 - name = "phabricator-${version}"; 6 - srcLibphutil = pkgs.fetchgit { 7 - url = git://github.com/facebook/libphutil.git; 8 - rev = "2f3b5a1cf6ea464a0250d4b1c653a795a90d2716"; 9 - sha256 = "9598cec400984dc149162f1e648814a54ea0cd34fcd529973dc83f5486fdd9fd"; 10 - }; 11 - srcArcanist = pkgs.fetchgit { 12 - url = git://github.com/facebook/arcanist.git; 13 - rev = "54c377448db8dbc40f0ca86d43c837d30e493485"; 14 - sha256 = "086db3c0d1154fbad23e7c6def31fd913384ee20247b329515838b669c3028e0"; 15 - }; 16 - srcPhabricator = pkgs.fetchgit { 17 - url = git://github.com/facebook/phabricator.git; 18 - rev = "1644ef185ecf1e9fca3eb6b16351ef46b19d110f"; 19 - sha256 = "e1135e4ba76d53f48aad4161563035414ed7e878f39a8a34a875a01b41b2a084"; 20 - }; 21 - 22 - buildCommand = '' 23 - mkdir -p $out 24 - cp -R ${srcLibphutil} $out/libphutil 25 - cp -R ${srcArcanist} $out/arcanist 26 - cp -R ${srcPhabricator} $out/phabricator 27 - ''; 28 - }; 29 in { 30 enablePHP = true; 31 extraApacheModules = [ "mod_rewrite" ]; 32 DocumentRoot = "${phabricatorRoot}/phabricator/webroot"; 33 extraConfig = '' 34 DocumentRoot ${phabricatorRoot}/phabricator/webroot 35 ··· 38 RewriteRule ^/favicon.ico - [L,QSA] 39 RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA] 40 ''; 41 }
··· 1 { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 let 6 + phabricatorRoot = pkgs.phabricator; 7 in { 8 + 9 enablePHP = true; 10 extraApacheModules = [ "mod_rewrite" ]; 11 DocumentRoot = "${phabricatorRoot}/phabricator/webroot"; 12 + 13 + options = { 14 + git = mkOption { 15 + default = true; 16 + description = "Enable git repositories."; 17 + }; 18 + mercurial = mkOption { 19 + default = true; 20 + description = "Enable mercurial repositories."; 21 + }; 22 + subversion = mkOption { 23 + default = true; 24 + description = "Enable subversion repositories."; 25 + }; 26 + }; 27 + 28 extraConfig = '' 29 DocumentRoot ${phabricatorRoot}/phabricator/webroot 30 ··· 33 RewriteRule ^/favicon.ico - [L,QSA] 34 RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA] 35 ''; 36 + 37 + extraServerPath = [ 38 + "${pkgs.which}" 39 + "${pkgs.diffutils}" 40 + ] ++ 41 + (if config.mercurial then ["${pkgs.mercurial}"] else []) ++ 42 + (if config.subversion then ["${pkgs.subversion}"] else []) ++ 43 + (if config.git then ["${pkgs.git}"] else []); 44 + 45 + startupScript = pkgs.writeScript "activatePhabricator" '' 46 + mkdir -p /var/repo 47 + chown wwwrun /var/repo 48 + ''; 49 + 50 }
+7
nixos/tests/phabricator.nix
··· 32 }]; 33 }; 34 35 mysql = { 36 enable = true; 37 package = pkgs.mysql; 38 }; 39 }; 40
··· 32 }]; 33 }; 34 35 + phd = { 36 + enable = true; 37 + }; 38 + 39 mysql = { 40 enable = true; 41 package = pkgs.mysql; 42 + extraOptions = '' 43 + sql_mode=STRICT_ALL_TABLES 44 + ''; 45 }; 46 }; 47
+28
pkgs/misc/phabricator/default.nix
···
··· 1 + { stdenv, fetchgit, pkgs, ... }: 2 + 3 + stdenv.mkDerivation rec { 4 + version = "2014-07-16"; 5 + name = "phabricator-${version}"; 6 + srcLibphutil = pkgs.fetchgit { 7 + url = git://github.com/facebook/libphutil.git; 8 + rev = "48a04395363d6c1dd9f66057bd11fd70d4665ba9"; 9 + sha256 = "d570d2c1e68471c2eda35b8722d8083bcc13163fbd5c944529464f2c7b55a2e5"; 10 + }; 11 + srcArcanist = pkgs.fetchgit { 12 + url = git://github.com/facebook/arcanist.git; 13 + rev = "97501da16416fbfdc6e84bd60abcbf5ad9506225"; 14 + sha256 = "9031c4ae228bdc986131e0c93c98fb73290bb0e297be1ec32f22ab09cdacafa3"; 15 + }; 16 + srcPhabricator = pkgs.fetchgit { 17 + url = git://github.com/phacility/phabricator.git; 18 + rev = "7ac5abb97934f7399b67762aa98f59f667711bf3"; 19 + sha256 = "6a1d449597ae4432e40a3e6cdb14e3a5a8a40e019f3930493064c35911f2adcc"; 20 + }; 21 + 22 + buildCommand = '' 23 + mkdir -p $out 24 + cp -R ${srcLibphutil} $out/libphutil 25 + cp -R ${srcArcanist} $out/arcanist 26 + cp -R ${srcPhabricator} $out/phabricator 27 + ''; 28 + }
+2
pkgs/top-level/all-packages.nix
··· 11421 11422 pgfplots = callPackage ../tools/typesetting/tex/pgfplots { }; 11423 11424 pjsip = callPackage ../applications/networking/pjsip { }; 11425 11426 polytable = callPackage ../tools/typesetting/tex/polytable { };
··· 11421 11422 pgfplots = callPackage ../tools/typesetting/tex/pgfplots { }; 11423 11424 + phabricator = callPackage ../misc/phabricator { }; 11425 + 11426 pjsip = callPackage ../applications/networking/pjsip { }; 11427 11428 polytable = callPackage ../tools/typesetting/tex/polytable { };