]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/tools/diaspora/diaspora.nix
Upgrade diaspora to latest version
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / diaspora / diaspora.nix
index 778fe267f415e494914b4d6ffc8bcbd59c757c6b..616c5cc6533faa13c53cd1257478c9a202463a52 100644 (file)
@@ -1,25 +1,31 @@
 { env, fetchedGithub, stdenv, defaultGemConfig, writeText, bundlerEnv, ruby_2_4, pkgs, cacert }:
 let
-  gems = bundlerEnv {
-    name = "diaspora-env";
-    ruby = ruby_2_4;
-    gemdir = ./.;
-    gemConfig = defaultGemConfig // {
-      kostya-sigar = attrs: {
-        buildInputs = with pkgs; [ pkgs.perl ];
-      };
-    };
-  };
   varDir = "/var/lib/diaspora_immae";
   socketsDir = "/run/diaspora";
   diaspora = stdenv.mkDerivation (fetchedGithub ./diaspora.json // rec {
     buildPhase = ''
       patch -p1 < ${./ldap.patch}
+      # FIXME: bundlerEnv below doesn't take postgresql group for some
+      # reason
+      echo 'gem "pg",     "1.1.3"' >> Gemfile
     '';
     installPhase = ''
       cp -a . $out
     '';
   });
+  gems = bundlerEnv {
+    name = "diaspora-env";
+    ruby = ruby_2_4;
+    gemfile = "${diaspora}/Gemfile";
+    lockfile = "${diaspora}/Gemfile.lock";
+    gemset = ./gemset.nix;
+    groups = [ "postgresql" "default" "production" ];
+    gemConfig = defaultGemConfig // {
+      kostya-sigar = attrs: {
+        buildInputs = [ pkgs.perl ];
+      };
+    };
+  };
   secret_token = writeText "secret_token.rb" ''
     Diaspora::Application.config.secret_key_base = '${env.secret_token}'
     '';