Hi, I am working with a team of other amateurs to develop an electron application for a senior design project. I thought it would be nice to use Nix to create an isolated cross-platform virtual environment. This is what that currently looks like:
{
description = "A basic flake providing a devShell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { nixpkgs, ... }: {
devShells = builtins.mapAttrs (system: pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs
electron
teamtype
];
shellHook = ''
# Forces npm to use the Nix-patched Electron binary
export ELECTRON_OVERRIDE_DIST_PATH="${pkgs.electron}/bin"
'';
};
}) nixpkgs.legacyPackages;
};
}
It worked great until I added electron-builder as an npm package. Electron-builder tries to download other tools which is of course not patched for Nix. And there doesn’t seem to be any way to tell electron-builder to use the equivalent Nix packages.
So from what I read I need to use a FHS environment. But we might have a team member who uses MacOS which doesn’t work with FHS under Nix. So what would you guys recommend for this situation? Thanks.