Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matthiasbeyer/333b43973c76704647f22f1b942ba5f3 to your computer and use it in GitHub Desktop.
Save matthiasbeyer/333b43973c76704647f22f1b942ba5f3 to your computer and use it in GitHub Desktop.
flake.nix
{
description = "Helper flake for rust dev envs";
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.11";
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, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
rustTarget = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
rustTarget
pkgs.openssl
pkgs.pkg-config
];
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment