!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

586 Members
Rust129 Servers

Load older messages


SenderMessageTime
3 Jul 2025
@tomasajt:matrix.orgTomaI'm also wondering whether we want to support fetching from other registries in the future. This would require some ret-con on the layout of the FOD itself, but it shouldn't be too bad.22:42:38
@tomasajt:matrix.orgToma *

I would like to revive some conversation around https://github.com/NixOS/nixpkgs/pull/387337

Currently PR's implementation creates a new subdirectory for each unique source that can be found in the lockfile

Here's an example of how the final directory layout might look like:

$ ls -A result/
.cargo  source-git-0  source-git-1  source-git-2  source-registry-0  Cargo.lock

$ cat result/.cargo/config.toml

[source._vendored-source-registry-0]
directory = "@vendor@/source-registry-0"

[source.crates-io]
replace-with = "_vendored-source-registry-0"

[source._vendored-source-git-0]
directory = "@vendor@/source-git-0"

[source._original-source-git-0]
git = "https://github.com/biomejs/biome"
rev = "2648fa4201be4afd26f44eca1a4e77aac0a67272"
replace-with = "_vendored-source-git-0"

[source._vendored-source-git-1]
directory = "@vendor@/source-git-1"

[source._original-source-git-1]
git = "https://github.com/lionel-/tower-lsp"
branch = "bugfix/patches"
replace-with = "_vendored-source-git-1"

[source._vendored-source-git-2]
directory = "@vendor@/source-git-2"

[source._original-source-git-2]
git = "https://github.com/r-lib/tree-sitter-r"
rev = "a0d3e3307489c3ca54da8c7b5b4e0c5f5fd6953a"
replace-with = "_vendored-source-git-2"
22:43:03
@tomasajt:matrix.orgToma *

I would like to revive some conversation around https://github.com/NixOS/nixpkgs/pull/387337

Currently the PR's implementation creates a new subdirectory for each unique source that can be found in the lockfile

Here's an example of how the final directory layout might look like:

$ ls -A result/
.cargo  source-git-0  source-git-1  source-git-2  source-registry-0  Cargo.lock

$ cat result/.cargo/config.toml

[source._vendored-source-registry-0]
directory = "@vendor@/source-registry-0"

[source.crates-io]
replace-with = "_vendored-source-registry-0"

[source._vendored-source-git-0]
directory = "@vendor@/source-git-0"

[source._original-source-git-0]
git = "https://github.com/biomejs/biome"
rev = "2648fa4201be4afd26f44eca1a4e77aac0a67272"
replace-with = "_vendored-source-git-0"

[source._vendored-source-git-1]
directory = "@vendor@/source-git-1"

[source._original-source-git-1]
git = "https://github.com/lionel-/tower-lsp"
branch = "bugfix/patches"
replace-with = "_vendored-source-git-1"

[source._vendored-source-git-2]
directory = "@vendor@/source-git-2"

[source._original-source-git-2]
git = "https://github.com/r-lib/tree-sitter-r"
rev = "a0d3e3307489c3ca54da8c7b5b4e0c5f5fd6953a"
replace-with = "_vendored-source-git-2"
22:43:12
@emilazy:matrix.orgemilydoes anything in practice use multiple registries?22:45:47
@tomasajt:matrix.orgTomaProbably people using some internal packages, idk22:46:35
@tomasajt:matrix.orgTomaAlso even if they were to use multiple registries, in most cases there wouldn't be any clash, so we could just put everything into the tarballs/ directory of the FOD.22:48:37
@tomasajt:matrix.orgTomaBtw I have https://github.com/NixOS/nixpkgs/pull/399775 which already has a POC implementation for using multiple registries (though it doesn't put everything into tarballs/)22:50:23
4 Jul 2025
@qaspr:matrix.orgJacoMalan1 joined the room.13:48:28
5 Jul 2025
@pblue3:matrix.orgPBlue3 joined the room.18:02:54
@kwiuu:matrix.orgkwiuu joined the room.20:42:27
6 Jul 2025
@qaspr:matrix.orgJacoMalan1 changed their display name from jacom to JacoMalan1.12:16:13
@qaspr:matrix.orgJacoMalan1 set a profile picture.12:58:03
@andrew15_5:matrix.orgAndrew

I want to build a Dioxus desktop app with webview from GNU/Linux to Windows. So far, this does build

# https://discourse.nixos.org/t/cross-compile-rust-for-windows/9582/10
{
  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,
    ...
  }: let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      inherit system;
      crossSystem.config = "x86_64-w64-mingw32";
      overlays = [(import rust-overlay)];
    };
    pkgsLocal = import nixpkgs {inherit system;};
    rust-toolchain = pkgs.pkgsBuildHost.rust-bin.stable.latest.default.override {
      extensions = ["rust-src" "rust-analyzer" "clippy"];
      targets = ["x86_64-pc-windows-gnu"];
    };
    # rustBuildInputs =
    #   [
    #     # pkgs.pthreads
    #     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
    with pkgs; {
      devShells.${system}.default = mkShell {
        buildInputs = [
          pkgs.openssl
          pkgs.libiconv
          # pkgs.windows.mingw_w64_pthreads
        ];
        nativeBuildInputs = [
          rust-toolchain
          pkgsLocal.wine64
        ];
      };
    };
}

with dx bundle --platform windows --target x86_64-pc-windows-gnu --package-types msi, though bundle isn't being created.
But I get an error that the webview 2 loader dll is not found, just like https://stackoverflow.com/questions/74217709/unable-to-load-dll-webview2loader-dll-the-specified-module-could-not-be-found, which links to https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution?tabs=dotnetcsharp.

Does nixpkgs not have the WebView2 runtime-related stuff or do I have to install the runtime on the target OS in order to run my app?

15:15:58
@k900:0upti.meK900You definitely need it on the target15:16:24
@k900:0upti.meK900And we definitely don't have it in nixpkgs15:16:29
@k900:0upti.meK900As it's not redistributable15:16:35
@andrew15_5:matrix.orgAndrewIs there any chance this can be included in the binary somehow?15:17:01
@marie:marie.cologneMarieIsn't webview2 part of windows?15:17:14
@k900:0upti.meK900No, it's a Microsoft proprietary library15:17:16
@k900:0upti.meK900 Only on 11 15:17:25
@k900:0upti.meK900It is optional on 10 and N/A on older versions15:17:36
@k900:0upti.meK900And they are running Wine which most definitely isn't helping15:17:47
@andrew15_5:matrix.orgAndrewOh, so on that it should just work, if no other dependencies are missing?15:17:53
@k900:0upti.meK900Possibly15:18:00
@andrew15_5:matrix.orgAndrewThat's interesting.15:18:09
@k900:0upti.meK900Oh actually no it won't because you're building for MinGW15:18:12
@k900:0upti.meK900So presumably you'll run into Exciting ABI Fuckery15:18:18
@andrew15_5:matrix.orgAndrewOK, is there a better way?15:18:36
@k900:0upti.meK900Build on native Windows15:18:43
@andrew15_5:matrix.orgAndrewAre you saying Nix can't save me?15:18:57

Show newer messages


Back to Room ListRoom Version: 6