dev: add flake.nix and .envrc for Rust dev environment

- rust-overlay for stable toolchain + rust-src + rust-analyzer
- pkg-config, openssl, sqlite for reqwest + ownership DB
- cargo-watch, cargo-nextest for dev workflow
- direnv integration via .envrc
This commit is contained in:
Ciphercat 2026-03-05 16:23:49 +00:00
commit d457c630c4
2 changed files with 40 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

39
flake.nix Normal file
View file

@ -0,0 +1,39 @@
{
description = "idx-cli CLI tool for Indonesian stock market (IDX) analysis";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analyzer" ];
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rustToolchain
pkg-config
openssl
sqlite
cargo-watch
cargo-nextest
];
env = {
RUST_BACKTRACE = "1";
};
};
}
);
}