Skip to content

Instantly share code, notes, and snippets.

@mattpetters
Last active September 20, 2024 03:51
Show Gist options
  • Save mattpetters/fcb39a6ad9826c429d09597e06c937f1 to your computer and use it in GitHub Desktop.
Save mattpetters/fcb39a6ad9826c429d09597e06c937f1 to your computer and use it in GitHub Desktop.
Nix development flake for Rust (WIP)
{
description = "Rust development environment";
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 =
[
pkg-config
openssl
]
++ lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
pkgs.darwin.apple_sdk.frameworks.Carbon
pkgs.darwin.apple_sdk.frameworks.WebKit
];
shellHook = ''
exec zsh
'';
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment