Add Nix flake development environment with direnv
This commit is contained in:
20
flake.nix
20
flake.nix
@@ -19,16 +19,32 @@
|
||||
cargo
|
||||
rustfmt
|
||||
clippy
|
||||
|
||||
cargo-watch
|
||||
|
||||
# C build tools (for your linker issue)
|
||||
gcc
|
||||
binutils
|
||||
pkg-config
|
||||
|
||||
# OpenSSL for crypto dependencies
|
||||
openssl
|
||||
openssl.dev
|
||||
|
||||
# PostgreSQL for sqlx
|
||||
postgresql
|
||||
sqlx-cli
|
||||
|
||||
# Protocol Buffers compiler for gRPC
|
||||
protobuf
|
||||
];
|
||||
|
||||
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 "Run 'cargo check' to verify everything works"
|
||||
echo "OpenSSL and PostgreSQL available"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user