aboutsummaryrefslogtreecommitdiff
path: root/flakes/grocy/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /flakes/grocy/default.nix
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository
Diffstat (limited to 'flakes/grocy/default.nix')
-rw-r--r--flakes/grocy/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/flakes/grocy/default.nix b/flakes/grocy/default.nix
new file mode 100644
index 0000000..26b6ed8
--- /dev/null
+++ b/flakes/grocy/default.nix
@@ -0,0 +1,47 @@
1{ varDir ? "/var/lib/grocy", stdenv, callPackage, composerEnv, fetchurl, src, runCommand, git, which, jq, yarn2nix-moretea }:
2let
3 version = "2.6.1-1";
4 patchedPackages = stdenv.mkDerivation rec {
5 name = "grocy";
6 inherit src;
7 buildInputs = [ jq ];
8 patches = [ ./yarn.patch ];
9 installPhase = ''
10 mkdir $out
11 cat package.json | jq -r '.version = "${version}"' > $out/package.json
12 cp yarn.lock $out/
13 '';
14 };
15 yarnModules = yarn2nix-moretea.mkYarnModules rec {
16 name = "grocy-yarn";
17 pname = name;
18 version = version;
19 packageJSON = "${patchedPackages}/package.json";
20 yarnLock = "${patchedPackages}/yarn.lock";
21 yarnNix = ./yarn-packages.nix;
22 pkgConfig = {
23 all = {
24 buildInputs = [ git which ];
25 };
26 };
27 };
28 app = composerEnv.buildPackage (
29 import ./php-packages.nix { inherit composerEnv fetchurl; } //
30 {
31 name = "grocy";
32 inherit src;
33 noDev = true;
34 buildInputs = [ yarnModules ];
35 postInstall = ''
36 rm -rf data
37 ln -sf ${varDir}/data data
38 ln -sf ${yarnModules}/node_modules public
39 '';
40 passthru = {
41 inherit varDir yarnModules;
42 webRoot = "${app}/public";
43 };
44 }
45 );
46in
47 app