-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: support nix shell dev environment (#17462)
Signed-off-by: Richard Chien <[email protected]> Co-authored-by: Richard Chien <[email protected]>
- Loading branch information
Showing
6 changed files
with
353 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,3 +81,5 @@ e2e_test/iceberg/spark-*-bin* | |
**/poetry.lock | ||
|
||
*.slt.temp | ||
|
||
.direnv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ inputs | ||
, ... | ||
}: | ||
|
||
{ | ||
perSystem = { pkgs, lib, ... }: { | ||
devshells.default = | ||
let | ||
rust-toolchain = with pkgs; | ||
[ | ||
((rust-bin.fromRustupToolchainFile ../../rust-toolchain).override { | ||
extensions = [ "rust-src" "rust-analyzer" ]; | ||
}) | ||
]; | ||
in | ||
{ | ||
imports = [ | ||
"${inputs.devshell}/extra/language/rust.nix" | ||
]; | ||
language.rust.enableDefaultToolchain = false; | ||
packages = rust-toolchain | ||
# See the dependencies list in docs/developer-guide.md | ||
++ (with pkgs; [ | ||
gcc | ||
lld | ||
protobuf | ||
pkg-config | ||
cyrus_sasl.out | ||
|
||
gnumake | ||
cmake | ||
maven | ||
jdk17_headless | ||
|
||
tmux | ||
postgresql | ||
patchelf | ||
]); | ||
env = [ | ||
{ | ||
name = "PKG_CONFIG_PATH"; | ||
value = lib.concatStringsSep ":" ( | ||
map (pkg: "${pkg}/lib/pkgconfig") (with pkgs; [ | ||
openssl.dev | ||
cyrus_sasl.dev | ||
]) | ||
); | ||
} | ||
{ | ||
name = "LD_LIBRARY_PATH"; | ||
value = lib.makeLibraryPath (with pkgs; [ | ||
openssl | ||
libgcc.lib | ||
cyrus_sasl.out | ||
]); | ||
} | ||
]; | ||
}; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# A nix flake that sets up a complete RisingWave development environment. | ||
# | ||
# You must have already installed Nix (https://nixos.org) on your system to use this. | ||
# Nix can be installed on Linux or MacOS; NixOS is not required. Windows is not | ||
# directly supported, but Nix can be installed inside of WSL2 or even Docker | ||
# containers. Please refer to https://nixos.org/download for details. | ||
# | ||
# You must also enable support for flakes in Nix. See the following for how to | ||
# do so permanently: https://nixos.wiki/wiki/Flakes#Enable_flakes | ||
# | ||
# Usage: | ||
# | ||
# With Nix installed, navigate to the directory containing this flake and run | ||
# `nix develop ./develop/nix`. | ||
# | ||
# You should now be dropped into a new shell with all programs and dependencies | ||
# available to you! | ||
# | ||
# You can exit the development shell by typing `exit`, or using Ctrl-D. | ||
# | ||
# If you would like this development environment to activate automatically | ||
# upon entering this directory in your terminal, first install `direnv` | ||
# (https://direnv.net/). Then run `echo 'use flake ./develop/nix' >> .envrc` at | ||
# the root of the RisingWave repo. Finally, run `direnv allow` to allow the | ||
# contents of '.envrc' to run every time you enter this directory. Voilà! | ||
# | ||
# note: If you don't want to see git untracked .envrc files bother you, | ||
# you can run `echo '.envrc' >> .git/info/exclude` in the root of project | ||
# to make it ignored locally. | ||
|
||
{ | ||
description = '' | ||
RisingWave the Cloud-native SQL stream processing, analytics, and management. | ||
''; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
|
||
devshell.url = "github:numtide/devshell"; | ||
|
||
rust-overlay = { | ||
url = "github:oxalica/rust-overlay"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = inputs@{ flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
imports = [ | ||
inputs.devshell.flakeModule | ||
./overlays.nix | ||
./devshell.nix | ||
]; | ||
|
||
systems = [ | ||
"x86_64-linux" | ||
"aarch64-linux" | ||
"aarch64-darwin" | ||
"x86_64-darwin" | ||
]; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ inputs | ||
, ... | ||
}: | ||
|
||
{ | ||
perSystem = { pkgs, system, ... }: { | ||
_module.args.pkgs = import inputs.nixpkgs { | ||
inherit system; | ||
overlays = [ | ||
(import inputs.rust-overlay) | ||
]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters