!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

659 Members
Rust152 Servers

Load older messages


SenderMessageTime
9 Dec 2025
@ralith:ralith.comRalith the nix code is utterly trivial, it's a shell with rustChannels.stable.rust and the env var I mentioned 04:04:38
@ralith:ralith.comRalithI don't know what "the sandbox" means here04:04:50
@pyrox:pyrox.devdish [Fox/It/She]
In reply to @ralith:ralith.com
I don't know what "the sandbox" means here
its the nix build sandbox, i.e the environment where builds happen in nix
04:22:15
@ralith:ralith.comRalithno idea, how do I go from a nix shell that I type "cargo test" into to that?04:22:58
@cashmere:cashmere.rscashmere changed their profile picture.11:26:39
10 Dec 2025
@truelle_trash_queen:matrix.orgTheodora changed their display name from Theodora The Absurdist Schizotisticoball to Theodora.12:17:19
11 Dec 2025
@creepinson:matrix.org@creepinson:matrix.org left the room.06:15:53
@theo-paris:matrix.orgTheo Paris joined the room.06:18:47
@suua:matrix.orgsuua joined the room.16:09:46
@winter:catgirl.cloudWinter anyone else's Cargo not getting completions for e.g. cargo add --[TAB] on fish? 21:12:07
@antifuchs:asf.computerantifuchsconfirm, I see that behavior too; could be it's not in the generated completions?21:39:26
@rosssmyth:matrix.orgrosssmythI do not see fish completions being generated in the cargo derivation. I'll put up a PR for them. 21:47:50
@rosssmyth:matrix.orgrosssmythhttps://github.com/NixOS/nixpkgs/pull/46999622:12:14
12 Dec 2025
@whispers:catgirl.cloudwhispers (it/fae) changed their profile picture.04:51:29
13 Dec 2025
@mjolnir:nixos.orgNixOS Moderation Bot unbanned @mightyiam:matrix.org@mightyiam:matrix.org.05:59:43
@dontblameme:matrix.org@dontblameme:matrix.org left the room.13:56:48
@rosssmyth:matrix.orgrosssmyth Forwarded from #review-requests:nixos.org
https://github.com/NixOS/nixpkgs/pull/458881
20:30:58
@rosssmyth:matrix.orgrosssmyth * Forwarded from #review-requests:nixos.org
https://github.com/NixOS/nixpkgs/pull/458881
https://matrix.to/#/!zihVdbsMjkhRfMQMXv:nixos.org/$wi0KSR9N8-Y70F_4CSfAYGc8BE7czevIqqsOoQDdnXo?via=nixos.org&via=matrix.org&via=tchncs.de
20:38:55
15 Dec 2025
@timon.zip:matrix.orgTimon joined the room.02:38:32
@noob_tea:matrix.orgtea joined the room.14:50:21
16 Dec 2025
@leighgable:matrix.orgleighgable joined the room.14:47:35
18 Dec 2025
@damccull:matrix.orgdamccull

Running nix shell github:oxalica/rust-overlay gives me rustc v1.92.0. however, my flake is giving me 1.86.0, and I need a later version. I cannot identify why it's not the latest. Can I get a second set of eyes, please?

{
  inputs = {
    nixpkgs = {
      url = "github:nixos/nixpkgs/nixos-unstable";
    };
    flake-utils.url = "github:numtide/flake-utils";
    rust-overlay.url = "github:oxalica/rust-overlay";
    surrealdb-gh.url = "github:surrealdb/surrealdb/v2.3.6";
    dioxus-cli-gh.url = "github:DioxusLabs/dioxus/v0.7.2";
  };
  outputs =
    inputs@{
      self,
      nixpkgs,
      flake-utils,
      ...
    }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = import nixpkgs {
          inherit system;
          overlays = [ (import inputs.rust-overlay) ];
          config = {
            allowUnfreePredicate =
              pkg:
              builtins.elem (lib.getName pkg) (
                [
                  "surrealdb"
                ]
                ++ (
                  if enableAndroid then
                    [
                      "android-sdk-tools"
                      "android-sdk-cmdline-tools"
                    ]
                  else
                    [ ]
                )
              );
            android_sdk.accept_license = true;
          };
        };

        lib = nixpkgs.lib;

        enableAndroid = false;

        androidSdk =
          let
            androidComposition = pkgs.androidenv.composeAndroidPackages {
              cmdLineToolsVersion = "13.0";
              # INFO: toolsVersion is unused because the tools package is deprecated
              # toolsVersion = "26.1.1";
              platformToolsVersion = "35.0.2";
              buildToolsVersions = [
                "34.0.0"
                "35.0.0"
              ];
              includeEmulator = true;
              emulatorVersion = "35.1.4";
              platformVersions = [
                "33"
              ];
              includeSources = false;
              includeSystemImages = true;
              systemImageTypes = [ "google_apis_playstore" ];
              abiVersions = [
                "x86_64"
                # "armeabi-v7a"
                # "arm64-v8a"
              ];
              cmakeVersions = [ "3.6.4111459" ];
              includeNDK = true;
              ndkVersions = [ "27.0.12077973" ];
              useGoogleAPIs = true;
              useGoogleTVAddOns = false;
              includeExtras = [
                "extras;google;gcm"
              ];
            };
          in
          androidComposition.androidsdk;

        androidDeps = with pkgs; [
          androidSdk
          openjdk
        ];

        dioxusDeps = with pkgs; [
          atkmm
          cairo
          fontconfig
          fribidi
          gdk-pixbuf
          glib
          glib-networking
          gtk3
          gsettings-desktop-schemas # Doesn't fix appimage bundle issue
          harfbuzz
          freetype
          libdrm
          libGL
          libgpg-error
          libsoup_3
          mesa
          openssl
          wrapGAppsHook3
          webkitgtk_4_1
          xdotool
          xorg.libX11
          xorg.libxcb
          zlib
          sqlite
        ];

        runtimeDeps = with pkgs; [
        ];

        buildDeps =
          with pkgs;
          [
            llvmPackages_21.clang-unwrapped
            pkg-config
            rustPlatform.bindgenHook
            (wasm-bindgen-cli.overrideAttrs (oldAttrs: rec {
              version = "0.2.100";
              src = fetchCrate {
                pname = "wasm-bindgen-cli";
                version = version;
                hash = "sha256-3RJzK7mkYFrs7C/WkhW9Rr4LdP5ofb2FdYGz1P7Uxog=";
              };

              cargoDeps = rustPlatform.fetchCargoVendor {
                inherit src;
                inherit (src) pname version;
                hash = "sha256-qsO12332HSjWCVKtf1cUePWWb9IdYUmT+8OPj/XP2WE=";
              };
            }))
          ]
          ++ dioxusDeps
          ++ (if enableAndroid then androidDeps else [ ]);

        devDeps =
          with pkgs;
          [
            # Libraries and programs needed for dev work; included in dev shell
            # NOT included in the nix build operation
            bacon
            bunyan-rs
            cargo-deny
            cargo-edit
            cargo-expand
            cargo-msrv
            cargo-nextest
            cargo-watch
            (cargo-whatfeatures.overrideAttrs (oldAttrs: rec {
              version = "0.9.13";
              src = fetchCrate {
                pname = "cargo-whatfeatures";
                version = "${version}";
                hash = "sha256-Nbyr7u47c6nImzYJvPVLfbqgDvzyXqR1C1tOLximuHU=";
              };

              cargoDeps = rustPlatform.fetchCargoVendor {
                inherit src;
                inherit (src) pname version;
                hash = "sha256-p95aYXsZM9xwP/OHEFwq4vRiXoO1n1M0X3TNbleH+Zw=";
              };
            }))
            fish
            gdb
            just
            nushell
            panamax
            tailwindcss
            zellij
          ]
          ++ [
            inputs.surrealdb-gh.packages.${system}.default
            inputs.dioxus-cli-gh.packages.${system}.dioxus-cli
          ];

        cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
        msrv = cargoToml.package.rust-version;

        rustPackage =
          features:
          (pkgs.makeRustPlatform {
            cargo = pkgs.rust-bin.stable.latest.minimal;
            rustc = pkgs.rust-bin.stable.latest.minimal;
          }).buildRustPackage
            {
              inherit (cargoToml.package) name version;
              src = ./.;
              cargoLock.lockFile = ./Cargo.lock;
              buildFeatures = features;
              buildInputs = runtimeDeps;
              nativeBuildInputs = buildDeps;
              # Uncomment if your cargo tests require networking or otherwise
              # don't play nicely with the nix build sandbox:
              # doCheck = false;
            };

        ldpath =
          with pkgs;
          [
          ]
          ++ dioxusDeps;

        mkDevShell =
          rustc:
          pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
            shellHook = ''
              # Override the path to ensure clang is before gcc
              export PATH=${pkgs.llvmPackages_21.clang-unwrapped}/bin:$PATH
              # TODO: figure out if it's possible to remove this or allow a user's preferred shell
              exec env SHELL=${pkgs.fish}/bin/fish zellij --layout ./zellij_layout.kdl
            '';
            LD_LIBRARY_PATH = lib.makeLibraryPath ldpath;

            # Override gcc with clang. Must use unwrapped version because the wrapper does not
            # allow passing a target as an argument, breaking wasm compiles
            CC = "${pkgs.llvmPackages_21.clang-unwrapped}/bin/clang";
            CXX = "${pkgs.llvmPackages_21.clang-unwrapped}/bin/clang++";

            ANDROID_HOME = if enableAndroid then "${androidSdk}/libexec/android-sdk" else "";
            ANDROID_NDK_HOME = if enableAndroid then "${androidSdk}/libexec/android-sdk/ndk-bundle" else "";

            GIO_MODULE_DIR = "${pkgs.glib-networking}/lib/gio/modules/";

            RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
            buildInputs = runtimeDeps;
            nativeBuildInputs = buildDeps ++ devDeps ++ [ rustc ];
          };

        rustTargets = [
          "x86_64-unknown-linux-gnu"
          "x86_64-linux-android"
          "aarch64-linux-android"
          "wasm32-unknown-unknown"
        ];

        rustExtensions = [
          "rust-analyzer"
          "rust-src"
        ];
      in
      rec {

        packages.default = packages.base;
        devShells.default = devShells.stable;

        packages.base = (rustPackage "");
        packages.bunyan = (rustPackage "bunyan");
        # packages.tokio-console = (rustPackage "tokio-console");

        devShells.nightly = (
          mkDevShell (
            pkgs.rust-bin.selectLatestNightlyWith (
              toolchain:
              toolchain.default.override {
                extensions = rustExtensions;
                targets = rustTargets;
              }
            )
          )
        );
        devShells.stable = (
          mkDevShell (
            pkgs.rust-bin.stable.latest.default.override {
              extensions = rustExtensions;
              targets = rustTargets;
            }
          )
        );
        devShells.msrv = (
          mkDevShell (
            pkgs.rust-bin.stable.${msrv}.default.override {
              extensions = rustExtensions;
              targets = rustTargets;
            }
          )
        );
      }
    );
}
18:29:45
@k900:0upti.meK900 nix flake update? 18:30:22
@damccull:matrix.orgdamccullDid it. Cargo update, too, via nix-shell -p cargo18:32:32
@damccull:matrix.orgdamccullI wonder if it's cargo-msrv returning incorrectly.18:32:43
@damccull:matrix.orgdamccullBut that seems to only affect the one shell option at the bottom, so maybe not18:33:46
@damccull:matrix.orgdamccull

If it helps, it's specifically crashing on dioxis-cli

these 3 derivations will be built:
  /nix/store/my5wjqmc7nvmprq294dwzadg56bvq3jd-cargo-msrv-0.18.4.drv
  /nix/store/w0gpqb602fba792p5y6shhk00jyjm72y-dioxus-cli-0.7.0.drv
  /nix/store/n6bw1dssgvgjfnxwx9igxgq9z1qikjmv-nix-shell.drv
building '/nix/store/w0gpqb602fba792p5y6shhk00jyjm72y-dioxus-cli-0.7.0.drv'...
building '/nix/store/my5wjqmc7nvmprq294dwzadg56bvq3jd-cargo-msrv-0.18.4.drv'...
error: builder for '/nix/store/w0gpqb602fba792p5y6shhk00jyjm72y-dioxus-cli-0.7.0.drv' failed with exit code 101;
       last 18 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/gyr049rgffgxbkv6fycn641krhl31jl7-source
       > source root is source
       > Executing cargoSetupPostUnpackHook
       > Finished cargoSetupPostUnpackHook
       > Running phase: patchPhase
       > Executing cargoSetupPostPatchHook
       > Validating consistency between /build/source/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
       > Finished cargoSetupPostPatchHook
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > error: rustc 1.86.0 is not supported by the following package:
       >   cargo-util-schemas@0.10.1 requires rustc 1.89
       > Either upgrade rustc or select compatible dependency versions with
       > `cargo update <name>@<current-ver> --precise <compatible-ver>`
       > where `<compatible-ver>` is the latest version supporting rustc 1.86.0
       >
       For full logs, run 'nix log /nix/store/w0gpqb602fba792p5y6shhk00jyjm72y-dioxus-cli-0.7.0.drv'.
error: 1 dependencies of derivation '/nix/store/n6bw1dssgvgjfnxwx9igxgq9z1qikjmv-nix-shell.drv' failed to build
18:34:56
@damccull:matrix.orgdamccullOoh, ok. Grok was useful this time. LLMs are starting to sometimes understand nix better. By having the dioxus-cli follow both nixpkgs and rust-overlay, it forced it to use my preferred versions rather than the version that comes with dioxus-cli. I guess I should report to dioxus their flake seems broken :D18:50:12
@damccull:matrix.orgdamccullWell, it's still compiliing so no guarantee yet, but I'll let you all know.18:50:45
@damccull:matrix.orgdamccullworked!18:55:38

Show newer messages


Back to Room ListRoom Version: 6