Skip to content

Commit 164a33c

Browse files
authored
chore: add nix flake setup (#270)
1 parent cd5f771 commit 164a33c

3 files changed

Lines changed: 164 additions & 1 deletion

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
tests-integration/test-server/target
44
tests-integration/rust-client/target
55
node_modules
6-
.DS_Store
6+
.DS_Store
7+
.direnv
8+
.envrc

flake.lock

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
description = "Development environment flake";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
6+
fenix = {
7+
url = "github:nix-community/fenix";
8+
inputs.nixpkgs.follows = "nixpkgs";
9+
};
10+
flake-utils.url = "github:numtide/flake-utils";
11+
};
12+
13+
outputs = { self, nixpkgs, fenix, flake-utils }:
14+
flake-utils.lib.eachDefaultSystem (system:
15+
let
16+
pkgs = nixpkgs.legacyPackages.${system};
17+
pythonEnv = pkgs.python3.withPackages (ps: with ps; [
18+
psycopg
19+
]);
20+
buildInputs = with pkgs; [
21+
llvmPackages.libclang
22+
duckdb.dev
23+
duckdb.lib
24+
sqlite.dev
25+
];
26+
in
27+
{
28+
devShells.default = pkgs.mkShell {
29+
nativeBuildInputs = with pkgs; [
30+
pkg-config
31+
clang
32+
git
33+
mold
34+
(fenix.packages.${system}.stable.withComponents [
35+
"cargo"
36+
"clippy"
37+
"rust-src"
38+
"rustc"
39+
"rustfmt"
40+
"rust-analyzer"
41+
])
42+
cargo-nextest
43+
cargo-release
44+
curl
45+
gnuplot ## for cargo bench
46+
pythonEnv
47+
postgresql
48+
];
49+
50+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
51+
shellHook = ''
52+
export CC=clang
53+
export CXX=clang++
54+
export SQLITE3_LIB_DIR="${pkgs.sqlite.dev}/lib"
55+
export SQLITE3_INCLUDE_DIR="${pkgs.sqlite.dev}/include"
56+
export DUCKDB_LIB_DIR="${pkgs.duckdb.lib}/lib"
57+
export DUCKDB_INCLUDE_DIR="${pkgs.duckdb.dev}/include"
58+
'';
59+
};
60+
});
61+
}

0 commit comments

Comments
 (0)