Skip to content

Commit

Permalink
Add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
rossnomann committed Apr 27, 2024
1 parent f25f809 commit a8e327c
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 0 deletions.
130 changes: 130 additions & 0 deletions flake.lock

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

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";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
overlays = [ inputs.rust-overlay.overlays.default ];
pkgs = import inputs.nixpkgs { inherit system overlays; };
rust = pkgs.rust-bin.stable.latest.default;
rust-analyzer = pkgs.rust-analyzer;
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
rust
rust-analyzer
];
shellHook = ''
export CARGO_HOME="$PWD/.cargo"
export PATH="$CARGO_HOME/bin:$PATH"
mkdir -p .cargo
echo '*' > .cargo/.gitignore
'';
};
}
);
}

0 comments on commit a8e327c

Please sign in to comment.