Add Nix flake development environment with direnv
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@
|
|||||||
/tantivy_indexes
|
/tantivy_indexes
|
||||||
server/tantivy_indexes
|
server/tantivy_indexes
|
||||||
steel_decimal/tests/property_tests.proptest-regressions
|
steel_decimal/tests/property_tests.proptest-regressions
|
||||||
|
.direnv/
|
||||||
|
|||||||
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1753549186,
|
||||||
|
"narHash": "sha256-Znl7rzuxKg/Mdm6AhimcKynM7V3YeNDIcLjBuoBcmNs=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "17f6bd177404d6d43017595c5264756764444ab8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
18
flake.nix
18
flake.nix
@@ -19,16 +19,32 @@
|
|||||||
cargo
|
cargo
|
||||||
rustfmt
|
rustfmt
|
||||||
clippy
|
clippy
|
||||||
|
cargo-watch
|
||||||
|
|
||||||
# C build tools (for your linker issue)
|
# C build tools (for your linker issue)
|
||||||
gcc
|
gcc
|
||||||
binutils
|
binutils
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
||||||
|
# OpenSSL for crypto dependencies
|
||||||
|
openssl
|
||||||
|
openssl.dev
|
||||||
|
|
||||||
|
# PostgreSQL for sqlx
|
||||||
|
postgresql
|
||||||
|
sqlx-cli
|
||||||
|
|
||||||
|
# Protocol Buffers compiler for gRPC
|
||||||
|
protobuf
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
|
export OPENSSL_DIR="${pkgs.openssl.dev}"
|
||||||
|
export OPENSSL_LIB_DIR="${pkgs.openssl.out}/lib"
|
||||||
|
export OPENSSL_INCLUDE_DIR="${pkgs.openssl.dev}/include"
|
||||||
echo "🦀 Rust development environment loaded"
|
echo "🦀 Rust development environment loaded"
|
||||||
echo "Run 'cargo check' to verify everything works"
|
echo "OpenSSL and PostgreSQL available"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user