Skip to content

Commit

Permalink
add nix setups
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonszelmann committed May 27, 2024
1 parent 9f53126 commit ae188b1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake;
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Cargo.lock
.vscode/
.idea/

*.dot
*.dot
.direnv
32 changes: 32 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};

outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
in {
devShells.default = pkgs.mkShell rec {
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
targets = [ "wasm32-unknown-unknown" ];
extensions = [ "rust-src" "rust-analyzer" ];
};
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";

buildInputs = with pkgs; [ trunk rustToolchain cargo-watch ];
};
});
}

0 comments on commit ae188b1

Please sign in to comment.