Skip to content

Commit 6b17736

Browse files
blackheavenorhun
andauthored
feat(nix): add a basic Nix environment (#918)
Co-authored-by: Orhun Parmaksız <[email protected]>
1 parent b604883 commit 6b17736

File tree

4 files changed

+141
-0
lines changed

4 files changed

+141
-0
lines changed

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
use flake
2+
dotenv_if_exists .env

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@
55
**/*.rs.bk
66

77
*.flamegraph.svg
8+
9+
# direnv
10+
/.direnv/
11+
12+
# Potential Nix stuff
13+
/result
14+
/result-*

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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
description = "git-cliff";
3+
4+
inputs = {
5+
nixpkgs.url =
6+
"github:nixos/nixpkgs/nixos-unstable"; # We want to use packages from the binary cache
7+
flake-utils.url = "github:numtide/flake-utils";
8+
rust-overlay.url = "github:oxalica/rust-overlay";
9+
};
10+
11+
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
12+
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
13+
let
14+
pkgs = import nixpkgs {
15+
inherit system;
16+
overlays = [ inputs.rust-overlay.overlays.rust-overlay ];
17+
};
18+
in {
19+
devShell = pkgs.mkShell {
20+
CARGO_INSTALL_ROOT = "${toString ./.}/.cargo";
21+
22+
buildInputs = with pkgs; [
23+
pkg-config
24+
openssl
25+
cargo-binutils
26+
cargo-watch
27+
lld
28+
(rust-bin.fromRustupToolchain {
29+
channel = "stable";
30+
components =
31+
[ "rust-analyzer" "rust-src" "rustfmt" "rustc" "cargo" "clippy" ];
32+
})
33+
];
34+
};
35+
});
36+
}

0 commit comments

Comments
 (0)