From 15568d4d2b41341eb0c6146d104e7f98d8ac6fac Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 3 Jun 2023 08:32:36 -0400 Subject: [PATCH] PLT-5930: Add dependencies needed for e2e tests. --- flake.lock | 17 +++++++++++++++++ flake.nix | 1 + nix/cells/marlowe-playground/devshells.nix | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/flake.lock b/flake.lock index e5d0c595b..223ca8348 100644 --- a/flake.lock +++ b/flake.lock @@ -1032,6 +1032,22 @@ "type": "github" } }, + "nixpkgs-babel": { + "locked": { + "lastModified": 1685792587, + "narHash": "sha256-SJZySQ1eblQWeNxCU0R7Ly1ZTQOW9A942eNNo/hQq2I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "39addc620d1585c4d95246f4e47c83467ae3e62a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "39addc620d1585c4d95246f4e47c83467ae3e62a", + "type": "github" + } + }, "nixpkgs-regression": { "locked": { "lastModified": 1643052045, @@ -1342,6 +1358,7 @@ "haskell-nix", "nixpkgs-unstable" ], + "nixpkgs-babel": "nixpkgs-babel", "npmlock2nix": "npmlock2nix", "pre-commit-hooks": "pre-commit-hooks", "std": "std_2" diff --git a/flake.nix b/flake.nix index 24bb0b556..dca3ab3cc 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ url = "github:NixOS/nixpkgs"; follows = "haskell-nix/nixpkgs-unstable"; }; + nixpkgs-babel.url = "github:NixOS/nixpkgs?rev=39addc620d1585c4d95246f4e47c83467ae3e62a"; haskell-nix = { url = "github:input-output-hk/haskell.nix"; inputs.hackage.follows = "hackage"; diff --git a/nix/cells/marlowe-playground/devshells.nix b/nix/cells/marlowe-playground/devshells.nix index 8aeb40760..2ab4f65b8 100644 --- a/nix/cells/marlowe-playground/devshells.nix +++ b/nix/cells/marlowe-playground/devshells.nix @@ -2,6 +2,14 @@ let inherit (cell) library packages scripts; inherit (library) pkgs haskell-nix cabal-project; + pkgs-babel = + if pkgs.nodePackages ? "@babel/cli" + then + throw "The main nixpkgs input now contains the babel command.\nPlease remove nixpkgs-babel from flake.nix, delete the pkgs-babel definition in devshells.nix, and replace the reference to pkgs-babel.nodePackages.\"@babel-cli\" with pkgs.nodePackages.\"@babel-cli\"" + else + import inputs.nixpkgs-babel { + system = pkgs.system; + }; haskell-devshell = haskell-nix.haskellLib.devshellFor cabal-project.shell; shell = inputs.std.lib.dev.mkShell { @@ -162,6 +170,15 @@ let pkgs.gawk pkgs.nil pkgs.z3 + ] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ + # None of these browsers build on Darwin, so limit e2e test-specific deps to Linux + pkgs.chromium + pkgs.firefox + pkgs.webkitgtk + pkgs.yarn + pkgs.nodePackages.rimraf + pkgs-babel.nodePackages."@babel/cli" + pkgs.nodePackages.ts-node ]; devshell.startup."pre-commit-check".text = cell.library.pre-commit-check.shellHook;