]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Temporarily fix mastodon package
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 1 Apr 2019 00:11:03 +0000 (02:11 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 1 Apr 2019 00:11:03 +0000 (02:11 +0200)
Upgrade from 18.09 to 19.03 broke because of change at
https://github.com/NixOS/nixpkgs/pull/51842
This partially reverts the change, which permits to build again mastodon
using the latest pkgs version.

Related issue: https://git.immae.eu/mantisbt/view.php?id=131

nixops/modules/websites/tools/mastodon/default.nix
nixops/modules/websites/tools/mastodon/mastodon.nix
nixops/scripts/nixops_wrap

index 9f9ea3f06bd8f3b4e222c398373774e0b497cd90..cff62007bf0d8846d9eba2a49e7343fa08dc96fb 100644 (file)
@@ -1,6 +1,6 @@
-{ lib, pkgs, pkgsPrevious, config, myconfig, mylibs, ... }:
+{ lib, pkgs, config, myconfig, mylibs, ... }:
 let
-  mastodon = pkgsPrevious.callPackage ./mastodon.nix {
+  mastodon = pkgs.callPackage ./mastodon.nix {
     inherit (mylibs) fetchedGithub;
     env = myconfig.env.tools.mastodon;
   };
index ef7ef576dfc70367ba6e957b44ffa658277280f5..bc4014d1bf5d432f532427862c697fadc962f344 100644 (file)
@@ -4,7 +4,10 @@ let
   socketsDir = "/run/mastodon";
   gems = bundlerEnv {
     name = "mastodon-env";
-    ruby = ruby_2_5;
+    # https://git.immae.eu/mantisbt/view.php?id=131
+    ruby = ruby_2_5.overrideAttrs(old: {
+      postInstall = builtins.replaceStrings [" --destdir $GEM_HOME"] [""] old.postInstall;
+    });
     gemset = ./gemset.nix;
     gemdir = (fetchedGithub ./mastodon.json).src;
     groups = [ "default" "production" "test" "development" ];
@@ -31,22 +34,20 @@ let
         pkgConfig = {
           uws = {
             postInstall = ''
-              node-gyp rebuild > build_log.txt 2>&1 || true
+              npx node-gyp rebuild > build_log.txt 2>&1 || true
               '';
-            buildInputs = with pkgs; [ nodePackages.node-gyp ];
           };
           node-zopfli = {
             postInstall = ''
-              node-pre-gyp install --fallback-to-build
+              npx node-pre-gyp install --fallback-to-build
               '';
-            buildInputs = with pkgs; [ nodePackages.node-pre-gyp ];
           };
           node-sass = {
             buildInputs = with pkgs; [ libsass python ];
             postInstall = let
               nodeHeaders = pkgs.fetchurl {
                 url = "https://nodejs.org/download/release/v${pkgs.nodejs.version}/node-v${pkgs.nodejs.version}-headers.tar.gz";
-                sha256 = "12zzsf8my43b8qnlacp871ih5vqafl2vlpqp51xp6h3gckn2frwy";
+                sha256 = "16f20ya3ys6w5w6y6l4536f7jrgk4gz46bf71w1r1xxb26a54m32";
               };
             in
               ''
index d6b66bdb3f98363b0e80d6a5aee0fa0091602344..bf41e81adfa739ee0ae270d2fc25abd870a85281 100755 (executable)
@@ -29,9 +29,9 @@ done
 nixops set-args --argstr privateFiles "$TEMP"
 
 # This will automatically upgrade to latest version at each build
-# nixpkgsNext="https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz"
-nixpkgsNext="https://releases.nixos.org/nixos/19.03/nixos-19.03beta171840.23fd1394dc6/nixexprs.tar.xz"
-nixpkgsPrevious="https://releases.nixos.org/nixos/18.09/nixos-18.09.1834.9d608a6f592/nixexprs.tar.xz"
-nixpkgs="$nixpkgsNext"
+# nixpkgs="https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz"
+nixpkgs="https://releases.nixos.org/nixos/19.03/nixos-19.03beta171840.23fd1394dc6/nixexprs.tar.xz"
+nixpkgsPrevious="$nixpkgs"
+nixpkgsNext="$nixpkgs"
 export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext:nixpkgsPrevious=$nixpkgsPrevious"
 nixops "$@"