# Do not use overrides in this file to add `meta.mainProgram` to packages. Use `./main-programs.nix` # instead. { pkgs, nodejs }: let inherit (pkgs) stdenv lib callPackage fetchFromGitHub fetchurl fetchpatch nixosTests; since = version: lib.versionAtLeast nodejs.version version; before = version: lib.versionOlder nodejs.version version; in final: prev: { inherit nodejs; "@angular/cli" = prev."@angular/cli".override { prePatch = '' export NG_CLI_ANALYTICS=false ''; nativeBuildInputs = [ pkgs.installShellFiles ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' for shell in bash zsh; do installShellCompletion --cmd ng \ --$shell <($out/bin/ng completion script) done ''; }; "@electron-forge/cli" = prev."@electron-forge/cli".override { buildInputs = [ final.node-gyp-build ]; }; expo-cli = prev."expo-cli".override (oldAttrs: { # The traveling-fastlane-darwin optional dependency aborts build on Linux. dependencies = builtins.filter (d: d.packageName != "@expo/traveling-fastlane-${if stdenv.hostPlatform.isLinux then "darwin" else "linux"}") oldAttrs.dependencies; }); fast-cli = prev.fast-cli.override { nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; prePatch = '' export PUPPETEER_SKIP_DOWNLOAD=1 ''; postInstall = '' wrapProgram $out/bin/fast \ --set PUPPETEER_EXECUTABLE_PATH ${pkgs.chromium.outPath}/bin/chromium ''; }; fauna-shell = prev.fauna-shell.override { # printReleaseNotes just pulls them from GitHub which is not allowed in sandbox preRebuild = '' sed -i 's|"node ./tools/printReleaseNotes"|"true"|' node_modules/faunadb/package.json ''; }; graphql-language-service-cli = prev.graphql-language-service-cli.override { nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; postInstall = '' wrapProgram "$out/bin/graphql-lsp" \ --prefix NODE_PATH : ${final.graphql}/lib/node_modules ''; }; ijavascript = prev.ijavascript.override (oldAttrs: { preRebuild = '' export npm_config_zmq_external=true ''; buildInputs = oldAttrs.buildInputs ++ [ final.node-gyp-build pkgs.zeromq ]; }); insect = prev.insect.override (oldAttrs: { nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ pkgs.psc-package final.pulp ]; }); joplin = prev.joplin.override (oldAttrs:{ nativeBuildInputs = [ pkgs.pkg-config (pkgs.python3.withPackages (ps: [ ps.setuptools ])) ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ pkgs.xcbuild ]; buildInputs = with pkgs; [ # required by sharp # https://sharp.pixelplumbing.com/install vips libsecret final.node-gyp-build node-pre-gyp pixman cairo pango ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.AppKit darwin.apple_sdk.frameworks.Security ]; # add newer node-addon-api to build sharp # https://github.com/lovell/sharp/issues/3920 dependencies = [ { name = "node-addon-api"; packageName = "node-addon-api"; version = "7.1.0"; src = fetchurl { url = "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz"; sha512 = "mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g=="; }; } ] ++ oldAttrs.dependencies; meta = oldAttrs.meta // { # ModuleNotFoundError: No module named 'distutils' broken = stdenv.hostPlatform.isDarwin; # still broken on darwin }; }); jsonplaceholder = prev.jsonplaceholder.override { buildInputs = [ nodejs ]; postInstall = '' exe=$out/bin/jsonplaceholder mkdir -p $out/bin cat >$exe <