Electron 7 Development Environment

Hi,
I am building an app with NodeJS and Electron 7. I am trying to write a shell.nix file for my development environment. However, I can’t figure out how to set up the Electron package: the most recent version of Electron in nixpkgs is version 6 (I need version 7).

I tried to copy electron_6 expression to the directory of my project (named it electron_7.nix). I changed the version to “7.1.2” and imported the package with callPackage ./electron_7.nix in shell.nix. However, when I enter the environment (nix-shell) and run electron --version it prints v6.0.1 and not v7.1.2.

I guess electron gets cached somehow because it also didn’t yell that hashes don’t match in fetchurl function calls.

How should I solve this issue?

Thanks in advance.

My shell.nix:

with import <nixpkgs> {};

let
  electron_7 = callPackage ./electron_7.nix {};
in mkShell {
  buildInputs = [
    electron_7
    nodejs
    yarn
  ];
}

Ok, I actually just needed to manually update the sha256 hash for fetchurl. I used nix-prefetch-url to get the new hash.

https://gist.github.com/anniekatlin/8d96ceec642705f7664126824bba11c3

{ pkgs ? import <nixpkgs> {} }:

(pkgs.buildFHSUserEnv {
  name = "electron-env";
  targetPkgs = pkgs: (with pkgs;
    [
      nodejs python libcxx systemd libpulseaudio libdrm mesa stdenv.cc.cc
      alsa-lib atk at-spi2-atk at-spi2-core cairo cups dbus expat fontconfig
      freetype gdk-pixbuf glib gtk3 libnotify libuuid nspr nss pango systemd
      libappindicator-gtk3 libdbusmenu libxkbcommon zlib
    ]
  ) ++ (with pkgs.xorg;
    [
      libXScrnSaver libXrender libXcursor libXdamage libXext libXfixes libXi
      libXrandr libX11 libXcomposite libxshmfence libXtst libxcb
    ]
  );
}).env