aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-06 01:40:40 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-06 01:40:40 +0200
commitbee035b7eb4dfe65f9787ae85beb46cec33a5c2f (patch)
tree3b9711f219ea52a3cbdfe8923873b7c5c1a4fb04
parent521a721dbf22bc65dfb61d899354c32ebb1fd8ae (diff)
downloadNix-bee035b7eb4dfe65f9787ae85beb46cec33a5c2f.tar.gz
Nix-bee035b7eb4dfe65f9787ae85beb46cec33a5c2f.tar.zst
Nix-bee035b7eb4dfe65f9787ae85beb46cec33a5c2f.zip
Move Shaarli package to overlays
-rw-r--r--nixops/modules/websites/tools/tools/shaarli.nix36
-rw-r--r--overlays/default.nix1
-rw-r--r--overlays/shaarli/default.nix10
-rw-r--r--overlays/shaarli/shaarli_ldap.patch (renamed from nixops/modules/websites/tools/tools/shaarli_ldap.patch)0
4 files changed, 13 insertions, 34 deletions
diff --git a/nixops/modules/websites/tools/tools/shaarli.nix b/nixops/modules/websites/tools/tools/shaarli.nix
index 19b27c2..2e89a47 100644
--- a/nixops/modules/websites/tools/tools/shaarli.nix
+++ b/nixops/modules/websites/tools/tools/shaarli.nix
@@ -1,45 +1,13 @@
1{ lib, env, stdenv, fetchurl }: 1{ lib, env, stdenv, fetchurl, shaarli }:
2
3let 2let
4 varDir = "/var/lib/shaarli"; 3 varDir = "/var/lib/shaarli";
5 shaarli = stdenv.mkDerivation rec {
6 name = "shaarli-${version}";
7 version = "0.10.2";
8
9 src = fetchurl {
10 url = "https://github.com/shaarli/Shaarli/releases/download/v${version}/shaarli-v${version}-full.tar.gz";
11 sha256 = "0h8sspj7siy3vgpi2i3gdrjcr5935fr4dfwq2zwd70sjx2sh9s78";
12 };
13
14 outputs = [ "out" "doc" ];
15
16 patches = [ ./shaarli_ldap.patch ];
17
18 installPhase = ''
19 rm -r {cache,pagecache,tmp,data}/
20 ln -sf ${varDir}/{cache,pagecache,tmp,data} .
21 mkdir -p $doc/share/doc
22 mv doc/ $doc/share/doc/shaarli
23 mkdir $out/
24 cp -R ./* $out
25 cp .htaccess $out/
26 '';
27
28 meta = with stdenv.lib; {
29 description = "The personal, minimalist, super-fast, database free, bookmarking service";
30 license = licenses.gpl3Plus;
31 homepage = https://github.com/shaarli/Shaarli;
32 maintainers = with maintainers; [ schneefux ];
33 platforms = platforms.all;
34 };
35 };
36in rec { 4in rec {
37 activationScript = '' 5 activationScript = ''
38 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ 6 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
39 ${varDir}/cache ${varDir}/pagecache ${varDir}/tmp ${varDir}/data \ 7 ${varDir}/cache ${varDir}/pagecache ${varDir}/tmp ${varDir}/data \
40 ${varDir}/phpSessions 8 ${varDir}/phpSessions
41 ''; 9 '';
42 webRoot = shaarli; 10 webRoot = shaarli varDir;
43 apache = rec { 11 apache = rec {
44 user = "wwwrun"; 12 user = "wwwrun";
45 group = "wwwrun"; 13 group = "wwwrun";
diff --git a/overlays/default.nix b/overlays/default.nix
index dcb122e..9ed703c 100644
--- a/overlays/default.nix
+++ b/overlays/default.nix
@@ -17,6 +17,7 @@
17 postgresql = import ./databases/postgresql; 17 postgresql = import ./databases/postgresql;
18 profanity = import ./profanity; 18 profanity = import ./profanity;
19 sc-im = import ./sc-im; 19 sc-im = import ./sc-im;
20 shaarli = import ./shaarli;
20 slrn = import ./slrn; 21 slrn = import ./slrn;
21 taskwarrior = import ./taskwarrior; 22 taskwarrior = import ./taskwarrior;
22 vit = import ./vit; 23 vit = import ./vit;
diff --git a/overlays/shaarli/default.nix b/overlays/shaarli/default.nix
new file mode 100644
index 0000000..c2fb9cc
--- /dev/null
+++ b/overlays/shaarli/default.nix
@@ -0,0 +1,10 @@
1self: super: {
2 shaarli = varDir: super.shaarli.overrideAttrs (old: {
3 patchPhase = "";
4 patches = (old.patches or []) ++ [ ./shaarli_ldap.patch ];
5 installPhase = (old.installPhase or "") + ''
6 cp .htaccess $out/
7 ln -sf ${varDir}/{cache,pagecache,tmp,data} $out/
8 '';
9 });
10}
diff --git a/nixops/modules/websites/tools/tools/shaarli_ldap.patch b/overlays/shaarli/shaarli_ldap.patch
index 9c7315a..9c7315a 100644
--- a/nixops/modules/websites/tools/tools/shaarli_ldap.patch
+++ b/overlays/shaarli/shaarli_ldap.patch