Merge: add foswiki service and required perl packages
This commit is contained in:
commit
483dc94cb9
4 changed files with 170 additions and 0 deletions
78
nixos/modules/services/web-servers/apache-httpd/foswiki.nix
Normal file
78
nixos/modules/services/web-servers/apache-httpd/foswiki.nix
Normal file
|
@ -0,0 +1,78 @@
|
|||
{ config, pkgs, lib, serverInfo, ... }:
|
||||
let
|
||||
inherit (pkgs) foswiki;
|
||||
inherit (serverInfo.serverConfig) user group;
|
||||
inherit (config) vardir;
|
||||
in
|
||||
{
|
||||
options.vardir = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/var/www/foswiki";
|
||||
description = "The directory where variable foswiki data will be stored and served from.";
|
||||
};
|
||||
|
||||
# TODO: this will probably need to be better customizable
|
||||
extraConfig =
|
||||
let httpd-conf = pkgs.runCommand "foswiki-httpd.conf"
|
||||
{ preferLocalBuild = true; }
|
||||
''
|
||||
substitute '${foswiki}/foswiki_httpd_conf.txt' "$out" \
|
||||
--replace /var/www/foswiki/ "${vardir}/"
|
||||
'';
|
||||
in
|
||||
''
|
||||
RewriteEngine on
|
||||
RewriteRule /foswiki/(.*) ${vardir}/$1
|
||||
|
||||
<Directory "${vardir}">
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
Include ${httpd-conf}
|
||||
<Directory "${vardir}/pub">
|
||||
Options FollowSymlinks
|
||||
</Directory>
|
||||
'';
|
||||
|
||||
/** This handles initial setup and updates.
|
||||
It will probably need some tweaking, maybe per-site. */
|
||||
startupScript = pkgs.writeScript "foswiki_startup.sh" (
|
||||
let storeLink = "${vardir}/package"; in
|
||||
''
|
||||
[ -e '${storeLink}' ] || needs_setup=1
|
||||
mkdir -p '${vardir}'
|
||||
cd '${vardir}'
|
||||
ln -sf -T '${foswiki}' '${storeLink}'
|
||||
|
||||
if [ -n "$needs_setup" ]; then # do initial setup
|
||||
mkdir -p bin lib
|
||||
# setup most of data/ as copies only
|
||||
cp -r '${foswiki}'/data '${vardir}/'
|
||||
rm -r '${vardir}'/data/{System,mime.types}
|
||||
ln -sr -t '${vardir}/data/' '${storeLink}'/data/{System,mime.types}
|
||||
|
||||
ln -sr '${storeLink}/locale' .
|
||||
|
||||
mkdir pub
|
||||
ln -sr '${storeLink}/pub/System' pub/
|
||||
|
||||
mkdir templates
|
||||
ln -sr '${storeLink}'/templates/* templates/
|
||||
|
||||
ln -sr '${storeLink}/tools' .
|
||||
|
||||
mkdir -p '${vardir}'/working/{logs,tmp}
|
||||
ln -sr '${storeLink}/working/README' working/ # used to check dir validity
|
||||
|
||||
chown -R '${user}:${group}' .
|
||||
chmod +w -R .
|
||||
fi
|
||||
|
||||
# bin/* and lib/* shall always be overwritten, in case files are added
|
||||
ln -srf '${storeLink}'/bin/* '${vardir}/bin/'
|
||||
ln -srf '${storeLink}'/lib/* '${vardir}/lib/'
|
||||
''
|
||||
/* Symlinking bin/ one-by-one ensures that ${vardir}/lib/LocalSite.cfg
|
||||
is used instead of ${foswiki}/... */
|
||||
);
|
||||
}
|
42
pkgs/servers/foswiki/default.nix
Normal file
42
pkgs/servers/foswiki/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ stdenv, fetchurl, perlPackages }:
|
||||
|
||||
perlPackages.buildPerlPackage rec {
|
||||
name = "foswiki-${version}";
|
||||
version = "2.1.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/foswiki/${version}/Foswiki-${version}.tgz";
|
||||
sha256 = "03286pb966h99zgickm2f20rgnqwp9wga5wfkdvirv084kjdh8vp";
|
||||
};
|
||||
|
||||
buildInputs = with perlPackages; [
|
||||
# minimum requirements from INSTALL.html#System_Requirements
|
||||
AlgorithmDiff ArchiveTar AuthenSASL CGI CGISession CryptPasswdMD5
|
||||
DigestSHA EmailMIME Encode Error FileCopyRecursive HTMLParser HTMLTree
|
||||
IOSocketIP IOSocketSSL JSON
|
||||
LocaleMaketext LocaleMaketextLexicon LocaleMsgfmt
|
||||
LWP URI perlPackages.version
|
||||
/*# optional dependencies
|
||||
libapreq2 DBI DBDmysql DBDPg DBDSQLite FCGI FCGIProcManager
|
||||
CryptSMIME CryptX509 ConvertPEM
|
||||
*/
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
touch Makefile.PL
|
||||
patchShebangs .
|
||||
'';
|
||||
configureScript = "bin/configure";
|
||||
|
||||
# there's even no makefile
|
||||
doCheck = false;
|
||||
installPhase = ''cp -r . "$out" ''; # TODO: some fixups will be needed for running it
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "An open, programmable collaboration platform";
|
||||
homepage = http://foswiki.org;
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
|
@ -9570,6 +9570,8 @@ let
|
|||
|
||||
fleet = callPackage ../servers/fleet { };
|
||||
|
||||
foswiki = callPackage ../servers/foswiki { };
|
||||
|
||||
freepops = callPackage ../servers/mail/freepops { };
|
||||
|
||||
freeswitch = callPackage ../servers/sip/freeswitch { };
|
||||
|
|
|
@ -370,6 +370,18 @@ let self = _self // overrides; _self = with self; {
|
|||
};
|
||||
};
|
||||
|
||||
ArchiveTar = buildPerlPackage {
|
||||
name = "Archive-Tar-2.04";
|
||||
src = fetchurl {
|
||||
url = mirror://cpan/authors/id/B/BI/BINGOS/Archive-Tar-2.04.tar.gz;
|
||||
sha256 = "c3741bba06a468a5a4db6a79d772c55cf2f6673cf33241a6e6a758707a71d293";
|
||||
};
|
||||
meta = {
|
||||
description = "Manipulates TAR archives";
|
||||
license = "perl";
|
||||
};
|
||||
};
|
||||
|
||||
ArchiveZip = buildPerlPackage {
|
||||
name = "Archive-Zip-1.16";
|
||||
src = fetchurl {
|
||||
|
@ -4682,6 +4694,18 @@ let self = _self // overrides; _self = with self; {
|
|||
buildInputs = [ ];
|
||||
};
|
||||
|
||||
FCGIProcManager = buildPerlPackage {
|
||||
name = "FCGI-ProcManager-0.25";
|
||||
src = fetchurl {
|
||||
url = mirror://cpan/authors/id/A/AR/ARODLAND/FCGI-ProcManager-0.25.tar.gz;
|
||||
sha256 = "b9ae1146e2638f3aa477c9ab3ceb728f92c5e36e4cce8f0b5847efad601d024d";
|
||||
};
|
||||
meta = {
|
||||
description = "A perl-based FastCGI process manager";
|
||||
license = "unknown";
|
||||
};
|
||||
};
|
||||
|
||||
FennecLite = buildPerlModule {
|
||||
name = "Fennec-Lite-0.004";
|
||||
src = fetchurl {
|
||||
|
@ -6077,6 +6101,18 @@ let self = _self // overrides; _self = with self; {
|
|||
};
|
||||
};
|
||||
|
||||
IOSocketIP = buildPerlPackage {
|
||||
name = "IO-Socket-IP-0.37";
|
||||
src = fetchurl {
|
||||
url = mirror://cpan/authors/id/P/PE/PEVANS/IO-Socket-IP-0.37.tar.gz;
|
||||
sha256 = "2adc5f0b641d41f662b4d99c0795780c62f9af9119884d053265fc8858ae6f7b";
|
||||
};
|
||||
meta = {
|
||||
description = "Family-neutral IP socket supporting both IPv4 and IPv6";
|
||||
license = "perl";
|
||||
};
|
||||
};
|
||||
|
||||
IOSocketInet6 = buildPerlPackage rec {
|
||||
name = "IO-Socket-INET6-2.72";
|
||||
src = fetchurl {
|
||||
|
@ -6728,6 +6764,18 @@ let self = _self // overrides; _self = with self; {
|
|||
};
|
||||
};
|
||||
|
||||
LocaleMsgfmt = buildPerlPackage {
|
||||
name = "Locale-Msgfmt-0.15";
|
||||
src = fetchurl {
|
||||
url = mirror://cpan/authors/id/A/AZ/AZAWAWI/Locale-Msgfmt-0.15.tar.gz;
|
||||
sha256 = "c3276831cbeecf58be02081bcc180bd348daa35da21a7737b7b038a59f643ab4";
|
||||
};
|
||||
meta = {
|
||||
description = "Compile .po files to .mo files";
|
||||
license = "perl";
|
||||
};
|
||||
};
|
||||
|
||||
LocalePO = buildPerlPackage {
|
||||
name = "Locale-PO-0.23";
|
||||
src = fetchurl {
|
||||
|
|
Loading…
Reference in a new issue