Need help building an electron application in a Nix dev shell

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.

Okay as you can all see below I created a FHS environment just for building and confirmed it works. But is it possible to modify my non-FHS devshell to enter this environment whenever “electron-builder” is executed, and run it there instead? That way nobody ever has to run nix develop .#build.

{
  description = "A basic flake providing a devShell";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  };

  outputs = { nixpkgs, ... }: {
    devShells = builtins.mapAttrs (
      system: pkgs:
      let
        devShell = pkgs.mkShell {
          packages = with pkgs; [
            nodejs
            electron
            teamtype
          ];
          shellHook = ''
            export ELECTRON_OVERRIDE_DIST_PATH="${pkgs.electron}/bin"
          '';
        };
      in
      {
        build =
          if pkgs.stdenv.hostPlatform.isLinux then
            (pkgs.buildFHSEnv {
              name = "electron-builder-env";
              targetPkgs =
                pkgs: with pkgs; [
                  nodejs
                  zlib
                ];
            }).env
          else
            devShell;
        default = devShell;
      }
    ) nixpkgs.legacyPackages;
  };
}