Skip to content

Commit

Permalink
Support multiple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-zahner committed Dec 13, 2024
1 parent 45a0f17 commit e321dcf
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,34 @@
...
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
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 = forAllSystems (system: {
default =
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
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"
];
};
in
pkgs.mkShell {
packages = [
pkgs.pkg-config
pkgs.openssl
rust
];
RUST_BACKTRACE = 1;
};
in
pkgs.mkShell {
packages = [
pkgs.pkg-config
pkgs.openssl
rust
];
RUST_BACKTRACE = 1;
};
});
};
}

0 comments on commit e321dcf

Please sign in to comment.