Skip to content

Instantly share code, notes, and snippets.

@MeexReay
Created August 19, 2024 23:30
Show Gist options
  • Save MeexReay/eaf5405d8e8f952305b4d67663c6ed4d to your computer and use it in GitHub Desktop.
Save MeexReay/eaf5405d8e8f952305b4d67663c6ed4d to your computer and use it in GitHub Desktop.
Rust project flake.nix template
{
description = "Rust project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
devShells.default = with pkgs; mkShell {
buildInputs = [
openssl
pkg-config
rust-bin.stable.latest.default
];
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment