From 737d76684125a95371702851cd99a523ef6ee057 Mon Sep 17 00:00:00 2001 From: John Murray <5672686+JRMurr@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:44:58 -0500 Subject: [PATCH] add node to dev inputs --- flake.nix | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index cfb5b92855..cf7a3c98ed 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,8 @@ description = "Roc flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?rev=676fe5e01b9a41fa14aaa48d87685677664104b1"; + nixpkgs.url = + "github:nixos/nixpkgs?rev=676fe5e01b9a41fa14aaa48d87685677664104b1"; # rust from nixpkgs has some libc problems, this is patched in the rust-overlay rust-overlay = { @@ -27,7 +28,9 @@ }; outputs = { self, nixpkgs, rust-overlay, flake-utils, nixgl, ... }@inputs: - let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ]; + let + supportedSystems = + [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ]; in flake-utils.lib.eachSystem supportedSystems (system: let overlays = [ (import rust-overlay) ] @@ -37,8 +40,9 @@ rocBuild = import ./nix { inherit pkgs; }; compile-deps = rocBuild.compile-deps; - inherit (compile-deps) zigPkg llvmPkgs llvmVersion - llvmMajorMinorStr glibcPath libGccSPath darwinInputs; + inherit (compile-deps) + zigPkg llvmPkgs llvmVersion llvmMajorMinorStr glibcPath libGccSPath + darwinInputs; # DevInputs are not necessary to build roc as a user linuxDevInputs = with pkgs; @@ -58,11 +62,11 @@ # DevInputs are not necessary to build roc as a user darwinDevInputs = with pkgs; lib.optionals stdenv.isDarwin - (with pkgs.darwin.apple_sdk.frameworks; [ - CoreVideo # for examples/gui - Metal # for examples/gui - curl # for wasm-bindgen-cli libcurl (see ./ci/www-repl.sh) - ]); + (with pkgs.darwin.apple_sdk.frameworks; [ + CoreVideo # for examples/gui + Metal # for examples/gui + curl # for wasm-bindgen-cli libcurl (see ./ci/www-repl.sh) + ]); # For debugging LLVM IR debugir = pkgs.stdenv.mkDerivation { @@ -116,6 +120,8 @@ wasm-pack # for repl_wasm jq # used in several bash scripts cargo-nextest # used to give more info for segfaults for gen tests + + nodejs_18 # for npx in `build-dev-local` ]); aliases = '' @@ -124,15 +130,15 @@ alias fmtc='cargo fmt --all -- --check' ''; - in - { + in { devShell = pkgs.mkShell { - buildInputs = sharedInputs ++ sharedDevInputs ++ darwinInputs ++ darwinDevInputs ++ linuxDevInputs + buildInputs = sharedInputs ++ sharedDevInputs ++ darwinInputs + ++ darwinDevInputs ++ linuxDevInputs ++ (if system == "x86_64-linux" then - [ pkgs.nixgl.nixVulkanIntel ] - else - [ ]); + [ pkgs.nixgl.nixVulkanIntel ] + else + [ ]); # nix does not store libs in /usr/lib or /lib # for libgcc_s.so.1 @@ -144,8 +150,8 @@ LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath - ([ pkg-config stdenv.cc.cc.lib libffi ncurses zlib ] - ++ linuxDevInputs); + ([ pkg-config stdenv.cc.cc.lib libffi ncurses zlib ] + ++ linuxDevInputs); NIXPKGS_ALLOW_UNFREE = 1; # to run the GUI examples with NVIDIA's closed source drivers @@ -160,7 +166,7 @@ # You can build this package (the roc CLI) with the `nix build` command. packages = { default = rocBuild.roc-cli; - + # all rust crates in workspace.members of Cargo.toml full = rocBuild.roc-full; # only the CLI crate = executable provided in nightly releases