diff options
author | Joachim F <joachifm@users.noreply.github.com> | 2018-02-17 10:47:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-17 10:47:23 +0000 |
commit | c826025163e34debca387a9b1fbe3cc36dcbf4de (patch) | |
tree | 0a55615f530322263cf7dbebab50c25c9a9a6be6 | |
parent | 3e2614702bdce1844e550b198505c6f8dca2de17 (diff) | |
parent | 012ead33e7477e5a05e6a5c12658ab642555f045 (diff) | |
download | nixlib-c826025163e34debca387a9b1fbe3cc36dcbf4de.tar nixlib-c826025163e34debca387a9b1fbe3cc36dcbf4de.tar.gz nixlib-c826025163e34debca387a9b1fbe3cc36dcbf4de.tar.bz2 nixlib-c826025163e34debca387a9b1fbe3cc36dcbf4de.tar.lz nixlib-c826025163e34debca387a9b1fbe3cc36dcbf4de.tar.xz nixlib-c826025163e34debca387a9b1fbe3cc36dcbf4de.tar.zst nixlib-c826025163e34debca387a9b1fbe3cc36dcbf4de.zip |
Merge pull request #33518 from schneefux/pkg.wallabag
wallabag: fix config file not being loaded from WALLABAG_DATA
-rw-r--r-- | pkgs/servers/web-apps/wallabag/default.nix | 13 | ||||
-rw-r--r-- | pkgs/servers/web-apps/wallabag/wallabag-data.patch | 26 |
2 files changed, 32 insertions, 7 deletions
diff --git a/pkgs/servers/web-apps/wallabag/default.nix b/pkgs/servers/web-apps/wallabag/default.nix index e6137a2db7c2..07b530f4ef72 100644 --- a/pkgs/servers/web-apps/wallabag/default.nix +++ b/pkgs/servers/web-apps/wallabag/default.nix @@ -13,13 +13,11 @@ stdenv.mkDerivation rec { outputs = [ "out" ]; - patchPhase = '' + patches = [ ./wallabag-data.patch ]; # exposes $WALLABAG_DATA + + prePatch = '' rm Makefile # use the "shared hosting" package with bundled dependencies - substituteInPlace app/AppKernel.php \ - --replace "__DIR__" "getenv('WALLABAG_DATA')" - substituteInPlace var/bootstrap.php.cache \ - --replace "\$this->rootDir = \$this->getRootDir()" "\$this->rootDir = getenv('WALLABAG_DATA')" - ''; # exposes $WALLABAG_DATA + ''; installPhase = '' mkdir $out/ @@ -31,11 +29,12 @@ stdenv.mkDerivation rec { longDescription = '' wallabag is a self hostable application for saving web pages. - To use, point the environment variable $WALLABAG_DATA to a directory called `app` that contains the folder `config` with wallabag's configuration files. These need to be updated every package upgrade. In `app`'s parent folder, a directory called `var` containing wallabag's data will be created. + Point the environment variable $WALLABAG_DATA to a data directory that contains the folder `app/config` which must be a clone of wallabag's configuration files with your customized `parameters.yml`. These need to be updated every package upgrade. After a package upgrade, empty the `var/cache` folder. ''; license = licenses.mit; homepage = http://wallabag.org; + maintainers = with maintainers; [ schneefux ]; platforms = platforms.all; }; } diff --git a/pkgs/servers/web-apps/wallabag/wallabag-data.patch b/pkgs/servers/web-apps/wallabag/wallabag-data.patch new file mode 100644 index 000000000000..086e93959800 --- /dev/null +++ b/pkgs/servers/web-apps/wallabag/wallabag-data.patch @@ -0,0 +1,26 @@ +diff --git a/app/AppKernel.php b/app/AppKernel.php +index 40726f05..7d44e600 100644 +--- a/app/AppKernel.php ++++ b/app/AppKernel.php +@@ -58,14 +58,19 @@ class AppKernel extends Kernel + return $bundles; + } + ++ public function getProjectDir() ++ { ++ return getenv('WALLABAG_DATA') ?: dirname(__DIR__); ++ } ++ + public function getCacheDir() + { +- return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); ++ return $this->getProjectDir() . '/var/cache/' . $this->getEnvironment(); + } + + public function getLogDir() + { +- return dirname(__DIR__) . '/var/logs'; ++ return $this->getProjectDir() . '/var/logs'; + } + + public function registerContainerConfiguration(LoaderInterface $loader) |