Last active
September 20, 2024 03:51
-
-
Save mattpetters/fcb39a6ad9826c429d09597e06c937f1 to your computer and use it in GitHub Desktop.
Nix development flake for Rust (WIP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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