21 platform = "linux-x64";
22 hash = "sha256-1W13AfXVRWTmDSRdsaPfSSJNlf59JXdI92tXBbYwdDI=";
25 platform = "linux-arm64";
26 hash = "sha256-rB0ak6jYnJMb0aHDLAyhaGoOFK4FXDLEOeofNdW/Wk8=";
29 platform = "darwin-arm64";
30 hash = "sha256-L2rhtB/DIK7Qum2YNoWVBn4mf+DA3rbcBUfZEEa/C8c=";
33 platform = "darwin-x64";
34 hash = "sha256-glJscAp0oHS1pqBt6fsQm0I5anl2HQ5YawIJuPG33II=";
37 inherit (stdenv.hostPlatform) system;
38 binary = availableBinaries.${system} or (throw "cypress: No binaries available for system ${system}");
39 inherit (binary) platform hash;
40 in stdenv.mkDerivation rec {
45 url = "https://cdn.cypress.io/desktop/${version}/${platform}/cypress.zip";
47 stripRoot = !stdenv.hostPlatform.isDarwin;
50 # don't remove runtime deps
58 ++ lib.optionals stdenv.hostPlatform.isLinux [
60 # override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
61 # Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
62 (buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
66 buildInputs = lib.optionals stdenv.hostPlatform.isLinux (with xorg; [
76 ]) ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
87 runtimeDependencies = lib.optional stdenv.hostPlatform.isLinux (lib.getLib udev);
92 mkdir -p $out/bin $out/opt/cypress
93 cp -vr * $out/opt/cypress/
94 # Let's create the file binary_state ourselves to make the npm package happy on initial verification.
95 # Cypress now verifies version by reading bin/resources/app/package.json
96 mkdir -p $out/bin/resources/app
97 printf '{"version":"%b"}' $version > $out/bin/resources/app/package.json
98 # Cypress now looks for binary_state.json in bin
99 echo '{"verified": true}' > $out/binary_state.json
100 ${if stdenv.hostPlatform.isDarwin then ''
101 ln -s $out/opt/cypress/Cypress.app/Contents/MacOS/Cypress $out/bin/cypress
103 ln -s $out/opt/cypress/Cypress $out/bin/cypress
108 postFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
109 # exit with 1 after 25.05
110 makeWrapper $out/opt/cypress/Cypress $out/bin/Cypress \
111 --run 'echo "Warning: Use the lowercase cypress executable instead of the capitalized one."'
115 updateScript = ./update.sh;
118 # We used to have a test here, but was removed because
119 # - it broke, and ofborg didn't fail https://github.com/NixOS/ofborg/issues/629
120 # - it had a large footprint in the repo; prefer RFC 92 or an ugly FOD fetcher?
121 # - the author switched away from cypress.
122 # To provide a test once more, you may find useful information in
123 # https://github.com/NixOS/nixpkgs/pull/223903
128 description = "Fast, easy and reliable testing for anything that runs in a browser";
129 homepage = "https://www.cypress.io";
130 mainProgram = "Cypress";
131 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
132 license = licenses.mit;
133 platforms = lib.attrNames availableBinaries;
134 maintainers = with maintainers; [ tweber mmahut Crafter ];