!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

681 Members
Rust155 Servers

Load older messages


SenderMessageTime
6 Jul 2025
@k900:0upti.meK900And Dioxus uses Tauri for all the OS specific bits15:25:50
@k900:0upti.meK900So presumably they inherit that limitation15:25:58
@reflux1291:catgirl.cloudDerpy (they/any) changed their display name from Any (they/any) to Derpy (they/any).17:00:28
@cathal_mullan:matrix.orgCathal changed their display name from CJ to Cathal.17:17:37
@andrew15_5:matrix.orgAndrewI have a single machine.17:57:43
@andrew15_5:matrix.orgAndrew

I left this just in case:

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

  outputs = {
    nixpkgs,
    rust-overlay,
    ...
  } @ inputs: let
    system = "x86_64-linux";

    pkgs = import nixpkgs {
      inherit system;
      overlays = [inputs.rust-overlay.overlays.default];
    };
    inherit (pkgs) lib;
    pkgsWin = import nixpkgs {
      inherit system;
      crossSystem.config = "x86_64-w64-mingw32";
      overlays = [(import rust-overlay)];
    };

    rust-toolchain-linux = pkgs.rust-bin.stable.latest.default.override {
      extensions = ["rust-src" "rust-analyzer" "clippy"];
    };
    rust-toolchain-windows = pkgsWin.pkgsBuildHost.rust-bin.stable.latest.default.override {
      extensions = ["rust-src" "rust-analyzer" "clippy"];
      targets = ["x86_64-pc-windows-gnu"];
    };

    rustBuildInputs =
      [
        pkgs.openssl
        pkgs.libiconv
        pkgs.pkg-config
      ]
      ++ lib.optionals pkgs.stdenv.isLinux [
        pkgs.glib
        pkgs.gtk3
        pkgs.libsoup_3
        pkgs.webkitgtk_4_1
        pkgs.xdotool
      ]
      ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
        IOKit
        Carbon
        WebKit
        Security
        Cocoa
      ]);
  in {
    devShells.${system} = {
      default = pkgs.mkShell {
        buildInputs = rustBuildInputs;
        nativeBuildInputs = [rust-toolchain-linux];
      };
      windows = pkgsWin.mkShell {
        # https://discourse.nixos.org/t/cross-compile-rust-for-windows/9582/10
        buildInputs = with pkgsWin; [openssl libiconv];
        # At least misses the Edge WebView2 Runtime (that can be bundled).
        nativeBuildInputs = [rust-toolchain-windows pkgs.wine64];
      };
    };
  };
}
17:57:57
@andrew15_5:matrix.orgAndrewApparently you can bundle the WebView2 Runtime with the app.17:58:21
@andrew15_5:matrix.orgAndrewMoreover, I succeeded and the binary actually produces (unarchives?) the WebView2 directory in the same PWD before the app can be run.17:59:27
@andrew15_5:matrix.orgAndrewapp.jpg
Download app.jpg
17:59:51
@andrew15_5:matrix.orgAndrewThough I need to ask Jon and Evan about this:18:00:07
@andrew15_5:matrix.orgAndrew3 things.jpg
Download 3 things.jpg
18:00:10
@andrew15_5:matrix.orgAndrewI assume the CLI binary both, adds the Runtime to PWD and launches the GUI.18:00:42
@andrew15_5:matrix.orgAndrewReally didn't expect a second window to appear when the app launches.18:01:18
@andrew15_5:matrix.orgAndrewIt also takes maybe like 30 seconds to copy about 11 MiB of runtime data before the app can actually show up. But after that it launches in one or two seconds.18:01:56
@andrew15_5:matrix.orgAndrewOverall, success. But at what cost...18:02:16
@andrew15_5:matrix.orgAndrewI thought a bit about it, and I think you can't really build any GUI cross-platform/from-Linux app and run it as is on any Windows system.18:03:28
@andrew15_5:matrix.orgAndrewLike for Python you'd have to install Python. Though you can technically bundle everything into a single binary. Not user if it works with GUI apps that use Qt or whatever.18:04:22
@andrew15_5:matrix.orgAndrewPerhaps same problems will arise with C++ apps.18:04:56
@andrew15_5:matrix.orgAndrewSo you kinda have to build natively...18:05:19
@andrew15_5:matrix.orgAndrewAlthough Dioxus Blitz supposedly can be statically linked, since it renders natively. But I haven't looked into this.18:06:23
@andrew15_5:matrix.orgAndrew Maybe https://github.com/rust-cross/cargo-xwin can just work. Though no Nix and no native dx support. 18:55:20
7 Jul 2025
@charles:computer.surgeryCharlescargo-llvm-cov added a git dev-dependency in its latest release that isn't reflected in Cargo.lock on crates.io, breaking nixpkgs' "download the lockfile from crates.io and build against that to avoid checking the entire lockfile into nixpkgs" workflow: https://github.com/taiki-e/cargo-llvm-cov/commit/fb528c913f5b5577b6971dae9d99d70babdd42e006:49:53
@charles:computer.surgeryCharleshow should i deal with this06:49:59
@charles:computer.surgeryCharles

i can think of two options:

  1. bug the maintainer to make a new release that fixes the crates.io lockfile (crates.io allows git dependencies in dev-dependencies)
  2. something else
06:50:35
@charles:computer.surgeryCharlesi feel like at this point i would prefer "something else" but i'm not sure what that should/could be06:51:42
@charles:computer.surgeryCharlessince it seems like repeatable builds are really not a priority for this maintainer06:51:56
@charles:computer.surgeryCharles * cargo-llvm-cov added a git dev-dependency in its latest release that isn't reflected in Cargo.lock on crates.io, breaking nixpkgs' "download the lockfile from crates.io and build against that to avoid checking the entire lockfile into nixpkgs" workflow: https://github.com/taiki-e/cargo-llvm-cov/commit/fb528c913f5b5577b6971dae9d99d70babdd42e0 06:52:51
@charles:computer.surgeryCharles

i guess checking in cargo.lock isn't that uncommon:

$ fd 'Cargo\.lock' | wc -l
110
06:55:59
@charles:computer.surgeryCharles *

i guess checking in cargo.lock isn't that uncommon:

$ fd '^Cargo\.lock$' | wc -l
97
06:56:26
@robert:scs.ems.hostRobert Rose changed their display name from Robert Rose - 🌴 04.07 to Robert Rose.07:58:40

Show newer messages


Back to Room ListRoom Version: 6