From bee035b7eb4dfe65f9787ae85beb46cec33a5c2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 6 May 2019 01:40:40 +0200 Subject: [PATCH] Move Shaarli package to overlays --- .../modules/websites/tools/tools/shaarli.nix | 36 ++----------------- overlays/default.nix | 1 + overlays/shaarli/default.nix | 10 ++++++ .../shaarli}/shaarli_ldap.patch | 0 4 files changed, 13 insertions(+), 34 deletions(-) create mode 100644 overlays/shaarli/default.nix rename {nixops/modules/websites/tools/tools => overlays/shaarli}/shaarli_ldap.patch (100%) 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 @@ -{ lib, env, stdenv, fetchurl }: - +{ lib, env, stdenv, fetchurl, shaarli }: let varDir = "/var/lib/shaarli"; - shaarli = stdenv.mkDerivation rec { - name = "shaarli-${version}"; - version = "0.10.2"; - - src = fetchurl { - url = "https://github.com/shaarli/Shaarli/releases/download/v${version}/shaarli-v${version}-full.tar.gz"; - sha256 = "0h8sspj7siy3vgpi2i3gdrjcr5935fr4dfwq2zwd70sjx2sh9s78"; - }; - - outputs = [ "out" "doc" ]; - - patches = [ ./shaarli_ldap.patch ]; - - installPhase = '' - rm -r {cache,pagecache,tmp,data}/ - ln -sf ${varDir}/{cache,pagecache,tmp,data} . - mkdir -p $doc/share/doc - mv doc/ $doc/share/doc/shaarli - mkdir $out/ - cp -R ./* $out - cp .htaccess $out/ - ''; - - meta = with stdenv.lib; { - description = "The personal, minimalist, super-fast, database free, bookmarking service"; - license = licenses.gpl3Plus; - homepage = https://github.com/shaarli/Shaarli; - maintainers = with maintainers; [ schneefux ]; - platforms = platforms.all; - }; - }; in rec { activationScript = '' install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ ${varDir}/cache ${varDir}/pagecache ${varDir}/tmp ${varDir}/data \ ${varDir}/phpSessions ''; - webRoot = shaarli; + webRoot = shaarli varDir; apache = rec { user = "wwwrun"; 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 @@ postgresql = import ./databases/postgresql; profanity = import ./profanity; sc-im = import ./sc-im; + shaarli = import ./shaarli; slrn = import ./slrn; taskwarrior = import ./taskwarrior; 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 @@ +self: super: { + shaarli = varDir: super.shaarli.overrideAttrs (old: { + patchPhase = ""; + patches = (old.patches or []) ++ [ ./shaarli_ldap.patch ]; + installPhase = (old.installPhase or "") + '' + cp .htaccess $out/ + ln -sf ${varDir}/{cache,pagecache,tmp,data} $out/ + ''; + }); +} diff --git a/nixops/modules/websites/tools/tools/shaarli_ldap.patch b/overlays/shaarli/shaarli_ldap.patch similarity index 100% rename from nixops/modules/websites/tools/tools/shaarli_ldap.patch rename to overlays/shaarli/shaarli_ldap.patch -- 2.41.0