Skip to content

Commit c42f64f

Browse files
author
Pierre BAILLET
committed
Add nix flake for dev
1 parent b3f6d1a commit c42f64f

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed

flake.lock

Lines changed: 96 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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
description = "A basic Rust development environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
rust-overlay.url = "github:oxalica/rust-overlay";
7+
flake-utils.url = "github:numtide/flake-utils";
8+
};
9+
10+
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
11+
flake-utils.lib.eachDefaultSystem (system:
12+
let
13+
overlays = [ (import rust-overlay) ];
14+
pkgs = import nixpkgs {
15+
inherit system overlays;
16+
};
17+
in
18+
{
19+
devShells.default = pkgs.mkShell {
20+
buildInputs = with pkgs; [
21+
# Rust toolchain
22+
(rust-bin.stable.latest.default.override {
23+
extensions = [ "rust-src" "rust-analyzer" ];
24+
})
25+
26+
# Common Rust development tools
27+
cargo
28+
rustc
29+
pkg-config
30+
openssl
31+
];
32+
33+
shellHook = ''
34+
echo "Rust development environment loaded!"
35+
rustc --version
36+
'';
37+
};
38+
});
39+
}

0 commit comments

Comments
 (0)