Rust: Difference between revisions

imported>Samuela
No edit summary
imported>Samuela
No edit summary
Line 17: Line 17:


=== VSCode integration ===
=== VSCode integration ===
The  
The [https://marketplace.visualstudio.com/items?itemName=rust-lang.rust rust-lang.rust] and [https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer matklad.rust-analyzer] VSCode extensions offer rust support. However, you'll need a few more ingredients to get everything working:
<syntaxHighlight lang="nix">
let
  # Pinned nixpkgs, deterministic. Last updated: 2/12/21.
  pkgs = import (fetchTarball("https://github.com/NixOS/nixpkgs/archive/a58a0b5098f0c2a389ee70eb69422a052982d990.tar.gz")) {};
 
  # Rolling updates, not deterministic.
  # pkgs = import (fetchTarball("channel:nixpkgs-unstable")) {};
in pkgs.mkShell {
  buildInputs = [
    pkgs.cargo
    pkgs.rustc
    pkgs.rustfmt
  ];
 
  # See https://discourse.nixos.org/t/rust-src-not-found-and-other-misadventures-of-developing-rust-on-nixos/11570/3?u=samuela.
  RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
}
</syntaxHighlight>


== Installation via rustup ==
== Installation via rustup ==
Line 23: Line 41:


== Unofficial overlays ==
== Unofficial overlays ==
TODO


== Rust Nightlies ==
== Rust Nightlies ==