summaryrefslogtreecommitdiff
path: root/pkgs/webapps/grocy/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-03-29 23:51:14 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-25 00:04:52 +0200
commit2c58f2ddbd86751724728c0d5ee7ffe60cfc0ed0 (patch)
tree5135dbc68cd5a544ab8cdb6e40b190e14e540945 /pkgs/webapps/grocy/default.nix
parent98a4617ca7a6f5ba78a078b1442a8651987e9070 (diff)
downloadNUR-2c58f2ddbd86751724728c0d5ee7ffe60cfc0ed0.tar.gz
NUR-2c58f2ddbd86751724728c0d5ee7ffe60cfc0ed0.tar.zst
NUR-2c58f2ddbd86751724728c0d5ee7ffe60cfc0ed0.zip
Add grocy
Diffstat (limited to 'pkgs/webapps/grocy/default.nix')
-rw-r--r--pkgs/webapps/grocy/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/webapps/grocy/default.nix b/pkgs/webapps/grocy/default.nix
new file mode 100644
index 00000000..3a8e55a5
--- /dev/null
+++ b/pkgs/webapps/grocy/default.nix
@@ -0,0 +1,45 @@
1{ varDir ? "/var/lib/grocy", stdenv, callPackage, composerEnv, fetchurl, mylibs, runCommand, git, which, jq }:
2let
3 version = "2.6.1-1";
4 packagesource = mylibs.fetchedGithub ./grocy.json;
5 patchedPackages = stdenv.mkDerivation (packagesource // rec {
6 buildInputs = [ jq ];
7 patches = [ ./yarn.patch ];
8 installPhase = ''
9 mkdir $out
10 cat package.json | jq -r '.version = "${version}"' > $out/package.json
11 cp yarn.lock $out/
12 '';
13 });
14 yarnModules = mylibs.yarn2nixPackage.mkYarnModules rec {
15 name = "grocy-yarn";
16 pname = name;
17 version = version;
18 packageJSON = "${patchedPackages}/package.json";
19 yarnLock = "${patchedPackages}/yarn.lock";
20 yarnNix = ./yarn-packages.nix;
21 pkgConfig = {
22 all = {
23 buildInputs = [ git which mylibs.yarn2nixPackage.src ];
24 };
25 };
26 };
27 app = composerEnv.buildPackage (
28 import ./php-packages.nix { inherit composerEnv fetchurl; } //
29 packagesource //
30 {
31 noDev = true;
32 buildInputs = [ yarnModules ];
33 postInstall = ''
34 rm -rf data
35 ln -sf ${varDir}/data data
36 ln -sf ${yarnModules}/node_modules public
37 '';
38 passthru = {
39 inherit varDir yarnModules;
40 webRoot = "${app}/public";
41 };
42 }
43 );
44in
45 app