-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
806132f
commit 3faf608
Showing
2 changed files
with
35 additions
and
75 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,47 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-parts = { | ||
url = "github:hercules-ci/flake-parts"; | ||
inputs.nixpkgs-lib.follows = "nixpkgs"; | ||
}; | ||
rust-overlay.url = "github:oxalica/rust-overlay"; | ||
}; | ||
|
||
outputs = | ||
inputs@{ self, flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = [ | ||
"x86_64-linux" | ||
"aarch64-linux" | ||
]; | ||
|
||
perSystem = | ||
{ | ||
config, | ||
self', | ||
inputs', | ||
pkgs, | ||
system, | ||
... | ||
}: | ||
{ | ||
_module.args.pkgs = import self.inputs.nixpkgs { | ||
inherit system; | ||
overlays = [ | ||
(import inputs.rust-overlay) | ||
{ | ||
nixpkgs, | ||
rust-overlay, | ||
... | ||
}: | ||
let | ||
system = "x86_64-linux"; | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ (import rust-overlay) ]; | ||
}; | ||
in | ||
{ | ||
devShells.${system}.default = | ||
let | ||
rustVersion = "latest"; # using a specific version: "1.62.0" | ||
rust = pkgs.rust-bin.stable.${rustVersion}.default.override { | ||
extensions = [ | ||
"rust-src" # for rust-analyzer | ||
"rust-analyzer" # usable by IDEs like zed-editor | ||
"clippy" | ||
]; | ||
}; | ||
devShells.default = | ||
let | ||
rustVersion = "latest"; # using a specific version: "1.62.0" | ||
rust = pkgs.rust-bin.stable.${rustVersion}.default.override { | ||
extensions = [ | ||
"rust-src" # for rust-analyzer | ||
"rust-analyzer" # usable by IDEs like zed-editor | ||
"clippy" | ||
]; | ||
}; | ||
libPath = | ||
with pkgs; | ||
lib.makeLibraryPath [ | ||
pkg-config | ||
openssl | ||
]; | ||
|
||
in | ||
pkgs.mkShell { | ||
inputsFrom = builtins.attrValues self'.packages; | ||
packages = [ | ||
pkgs.pkg-config | ||
pkgs.openssl | ||
rust | ||
]; | ||
LD_LIBRARY_PATH = libPath; | ||
RUST_BACKTRACE = 1; | ||
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; | ||
}; | ||
libPath = pkgs.lib.makeLibraryPath [ | ||
pkgs.pkg-config | ||
pkgs.openssl | ||
]; | ||
in | ||
pkgs.mkShell { | ||
packages = [ | ||
pkgs.pkg-config | ||
pkgs.openssl | ||
rust | ||
]; | ||
LD_LIBRARY_PATH = libPath; | ||
RUST_BACKTRACE = 1; | ||
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; | ||
}; | ||
}; | ||
} |