]>
Commit | Line | Data |
---|---|---|
1 | { varDir ? "/var/lib/grocy", stdenv, callPackage, composerEnv, fetchurl, mylibs, runCommand, git, which, jq, yarn2nix-moretea }: | |
2 | let | |
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 = yarn2nix-moretea.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 ]; | |
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 | ); | |
44 | in | |
45 | app |