]>
Commit | Line | Data |
---|---|---|
7667c367 IB |
1 | { siteName ? "spip" |
2 | , siteDir ? runCommand "empty" { preferLocalBuild = true; } "mkdir -p $out" | |
3 | , environment ? "prod" | |
4 | , ldap ? false | |
5 | , varDir ? "/var/lib/${siteName}_${environment}" | |
a08b46f2 | 6 | , lib, fetchzip, runCommand, stdenv, php82 }: |
7667c367 IB |
7 | let |
8 | app = stdenv.mkDerivation rec { | |
9 | name = "${siteName}-${environment}-spip-${version}"; | |
a08b46f2 | 10 | version = "4.2.9"; |
7667c367 | 11 | src = fetchzip { |
ea8a30bb | 12 | url = "https://files.spip.net/spip/archives/spip-v${version}.zip"; |
a08b46f2 | 13 | sha256 = "sha256-eHQ0q6f8/bFtuxn5LvAtKp3OaDGRCdVUh3kug8iBIbA="; |
ea8a30bb | 14 | stripRoot = false; |
7667c367 IB |
15 | }; |
16 | paches = lib.optionals ldap [ ./spip_ldap_patch.patch ]; | |
17 | buildPhase = '' | |
18 | rm -rf IMG local tmp config/remove.txt | |
19 | ln -sf ${./spip_mes_options.php} config/mes_options.php | |
20 | echo "Require all denied" > "config/.htaccess" | |
21 | ln -sf ${varDir}/{IMG,local} . | |
22 | ''; | |
23 | installPhase = '' | |
24 | cp -a . $out | |
25 | cp -a ${siteDir}/* $out | |
26 | ''; | |
27 | passthru = { | |
a08b46f2 IB |
28 | php = php82; |
29 | phpExtensions = all: [ all.curl all.xml all.gd all.sodium all.zip all.zlib all.mysqli ]; | |
7667c367 IB |
30 | inherit siteName siteDir environment varDir; |
31 | webRoot = app; | |
32 | spipConfig = ./spip_mes_options.php; | |
33 | }; | |
34 | }; | |
35 | in app |