]>
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}" | |
6 | , lib, fetchzip, runCommand, stdenv }: | |
7 | let | |
8 | app = stdenv.mkDerivation rec { | |
9 | name = "${siteName}-${environment}-spip-${version}"; | |
ea8a30bb | 10 | version = "3.2.18"; |
7667c367 | 11 | src = fetchzip { |
ea8a30bb IB |
12 | url = "https://files.spip.net/spip/archives/spip-v${version}.zip"; |
13 | sha256 = "sha256-KNw9G3PEHpVvsBvKsZfqNaymhwHkJ28F8a44qr5tQyw="; | |
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 = { | |
28 | inherit siteName siteDir environment varDir; | |
29 | webRoot = app; | |
30 | spipConfig = ./spip_mes_options.php; | |
31 | }; | |
32 | }; | |
33 | in app |