!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

671 Members
Rust151 Servers

Load older messages


SenderMessageTime
11 Jun 2026
@johnwangfed:matrix.orgJohn Wang changed their display name from john wang to John Wang.11:44:01
@lav:xmr.selav joined the room.23:50:42
13 Jun 2026
@debtquity:matrix.orgdebtquity set a profile picture.03:22:51
15 Jun 2026
@truelle_trash_queen:matrix.orgTheodora changed their profile picture.14:48:11
@tlater:matrix.tlater.nettlater left the room.17:32:11
17 Jun 2026
@debtquity:matrix.orgdebtquityScreenshot 2026-06-17 at 02.44.02.png
Download Screenshot 2026-06-17 at 02.44.02.png
07:44:55
@debtquity:matrix.orgdebtquityI am building a rust package on my remote builders (orb stack vms with nixos [26.11]) but seems most of the work is just running on a single core. It it like this for everyone else, or just me? 07:45:19
@debtquity:matrix.orgdebtquityI have an M4 Mac as host, if that matters07:45:36
@k900:0upti.meK900Depends on the rustc configuration07:46:32
@k900:0upti.meK900 But a lot of projects, especially the 🚀 BLAZING FAST ✨️ ones will force codegen-units=1 to get the bestest performancest 07:47:02
@debtquity:matrix.orgdebtquity damn, forgot about that pesky codegen-units setting. sometimes i regret using rust lol 07:55:13
@screaming:lobotomise.meaphasic it's more for minimal executable size I thought 08:00:06
@kranzes:matrix.orgIlan Joselevich (Kranzes)Nope, https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units09:50:25
@marienz:matrix.orgmarienz Places like https://github.com/johnthagen/min-sized-rust#reduce-parallel-code-generation-units-to-increase-optimization recommend it for "maximum size reduction optimizations" (and I think that isn't the only place I've seen that suggestion) 09:52:25
@marienz:matrix.orgmarienz(Doesn't really matter if it's true, there'll be a few projects finding that and trusting the advice)09:53:16
18 Jun 2026
@whispers:catgirl.cloudwhispers [& it/fae] changed their display name from whispers [& it/fae] to the void.18:45:38
@whispers:catgirl.cloudwhispers [& it/fae] changed their display name from the void to meow meow.18:46:18
@whispers:catgirl.cloudwhispers [& it/fae] changed their display name from meow meow to whispers [& it/fae].19:11:27
@heartfelt_heron:matrix.orgHeartfelt Heron joined the room.22:11:08
22 Jun 2026
@colemickens:matrix.orgcolemickenshow is there not a single example of how to set RUST_SRC_PATH when using craneLib.devShell?04:47:53
@colemickens:matrix.orgcolemickenslike, anywhere04:47:58
@djacu:matrix.orgdjacu
In reply to @colemickens:matrix.org
how is there not a single example of how to set RUST_SRC_PATH when using craneLib.devShell?
yeah... i couldn't find one either. but looks like you would just pass that arg and it would get threaded to mkShell.
05:37:25
@colemickens:matrix.orgcolemickensI am not crane-smart enough to figure out how to derive that from crane's toolchain based on the scaffolding I have05:38:06
@colemickens:matrix.orgcolemickensthe random snippets online just grab it from pkgs.rustPlatform which just doens't feel correct at all for crane?05:38:23
@djacu:matrix.orgdjacu

If your using nixpkgs to populate craneLib like this in their examples

pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.mkLib pkgs;

It looks like it would pull cargo, clippy, rustc, and rustfmt from nixpkgs. So I guess the RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; is the closest thing to correct but yeah it does feel a bit off

Are you using nixpkgs or another toolchain provider?

05:58:22
@orowith2os:fedora.imYves (she/they) changed their profile picture.08:47:33
@mib:kanp.aimib 🥐

if you're using both oxalica/rust-overlay and ipetkov/crane, e.g. to pick crane's toolchain from rust-overlay, then you can do something like the following to pick the correct rust src: (shown using different scaffolding than flake-utils because i don't like it)

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

    crane.url = "github:ipetkov/crane";

    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };

  };

  outputs =
    {
      nixpkgs,
      crane,
      rust-overlay,
      ...
    }:
    let
      inherit (nixpkgs) lib;
      inherit (lib.attrsets) genAttrs;

      forAllSystems =
        maker:
        genAttrs lib.systems.flakeExposed (
          system:
          maker rec {
            inherit system;
            pkgs = import nixpkgs {
              inherit system;
              overlays = [ rust-overlay.overlays.default ];
            };
            rust = rustFor pkgs;
            crane = craneFor pkgs;
          }
        );

      rustFor = pkgs: pkgs.rust-bin.stable.latest;
      craneFor = pkgs: (crane.mkLib pkgs).overrideToolchain (pkgs': (rustFor pkgs').default);
    in
    {
      packages = forAllSystems (
        { crane, ... }:
        {
          default = crane.buildPackage {
            # ...
          };
        }
      );

      devShells = forAllSystems (
        { crane, rust, ... }: {
          default = crane.devShell {
            # ...

            "RUST_SRC_PATH" = "${rust.rust-src}/lib/rustlib/src/rust/library";
          };
        }
      );
    };
}
12:47:21
@colemickens:matrix.orgcolemickensThank you both. Both helped me advance my understanding and sort this out, really appreciate you both.17:30:49
@albertlarsan68:albertlarsan.frAlbert Larsan left the room.17:44:20
23 Jun 2026
@albertlarsan68:albertlarsan.frAlbert Larsan joined the room.07:44:24

Show newer messages


Back to Room ListRoom Version: 6