Skip to content

Commit

Permalink
feat(nix): add a basic Nix environment (#918)
Browse files Browse the repository at this point in the history
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
  • Loading branch information
blackheaven and orhun authored Oct 16, 2024
1 parent b604883 commit 6b17736
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake
dotenv_if_exists .env
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@
**/*.rs.bk

*.flamegraph.svg

# direnv
/.direnv/

# Potential Nix stuff
/result
/result-*
96 changes: 96 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
description = "git-cliff";

inputs = {
nixpkgs.url =
"github:nixos/nixpkgs/nixos-unstable"; # We want to use packages from the binary cache
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ inputs.rust-overlay.overlays.rust-overlay ];
};
in {
devShell = pkgs.mkShell {
CARGO_INSTALL_ROOT = "${toString ./.}/.cargo";

buildInputs = with pkgs; [
pkg-config
openssl
cargo-binutils
cargo-watch
lld
(rust-bin.fromRustupToolchain {
channel = "stable";
components =
[ "rust-analyzer" "rust-src" "rustfmt" "rustc" "cargo" "clippy" ];
})
];
};
});
}

0 comments on commit 6b17736

Please sign in to comment.