| 5 Jan 2026 |
Theo Paris | Alternatively I could use rustup but I'd like to get nixpkgs cross working | 03:21:11 |
Theo Paris | * Alternatively I could use rustup but I'd like to get nixpkgs cross compilation working | 03:21:25 |
| goodtab joined the room. | 08:22:22 |
| Frédéric Christ changed their display name from Frédéric Christ (back on 02.01.) to Frédéric Christ. | 09:38:37 |
| Epic Eric changed their display name from Eric Pires to Epic Eric. | 09:39:12 |
niklaskorz | we have the wasm targets as part of the normal rust toolchain, so you don't necessarily need pkgsCross | 12:20:01 |
niklaskorz | i.e. you can target wasm32-unknown-none from any system's pkgs.rustc | 12:20:15 |
| @robin:icewind.nl left the room. | 14:12:04 |
| 6 Jan 2026 |
| eyduh (she/they) changed their profile picture. | 18:20:52 |
| eyduh (she/they) changed their profile picture. | 18:25:31 |
| 7 Jan 2026 |
| accelbread joined the room. | 04:26:13 |
accelbread | Does anybody know how to get miri with nixpkgs rustc? do I just override configureFlags? | 04:27:11 |
Epic Eric | Redacted or Malformed Event | 10:33:54 |
Epic Eric | Maybe via pkgs.rustup? cargo-miri seems to be part of it | 10:50:58 |
accelbread | didn't want to use rustup, though I got it working with some messy buildRustPackage | 10:51:35 |
Epic Eric | It might be worth making a Nix package for it | 10:52:33 |
accelbread | That would be useful, yeah
Though idk if what I ended up with would be usable in nixpkgs: https://codeberg.org/accelbread/basis-rs/commit/7a9c1b4fb9a269a2c0f819d892c932e93dd97250
install phase was broken with sourceRoot set since it expected to be in same dir as target though target got created at root of unpacked source, not sourceRoot. And cargoRoot didnt work; got some weird errors about incorrect hashes when using it | 10:55:53 |
accelbread | hmm actually might be simpler to use rustc.src's vendor dir if that has everything miri/cargo-miri needs... | 11:06:52 |
emily | doesn't Miri require nightly? | 14:46:48 |
emily | have you considered rust-overlay? | 14:47:26 |
emily | you can get the Nightly binaries packaged in Nix that way | 14:47:40 |
accelbread | yeah, those are binary builds though. And I don't want another flake dependency. I built it with nix rustc with RUSTC_BOOTSTRAP=1, to enable unstable features | 22:09:12 |
| 8 Jan 2026 |
Epic Eric | Does anybody by some chance have a dev environment for working with godot-rust? | 00:23:31 |
Epic Eric | Far from the best but at least I managed to do what I wanted to do with this dirty shell
let
sources = import ./npins;
pkgs = import sources.nixpkgs {
overlays = [ (import sources.rust-overlay) ];
};
pkgs-cross-mingw = import pkgs.path {
crossSystem = {
config = "x86_64-w64-mingw32";
};
};
mingw_w64_cc = pkgs-cross-mingw.stdenv.cc;
mingw_w64 = pkgs-cross-mingw.windows.mingw_w64;
mingw_w64_pthreads_w_static = pkgs-cross-mingw.windows.pthreads.overrideAttrs (oldAttrs: {
configureFlags = (oldAttrs.configureFlags or [ ]) ++ [
"--enable-static"
];
});
in
pkgs.mkShell {
packages = [
pkgs.bacon
pkgs.godot_4_5
pkgs.godot_4_5-export-templates-bin
mingw_w64_cc
(pkgs.rust-bin.stable.latest.default.override {
targets = [ "x86_64-pc-windows-gnu" ];
})
pkgs.wineWowPackages.stable
];
WINDOWS_RUSTFLAGS = (
map (a: ''-L ${a}/lib'') [
mingw_w64
mingw_w64_pthreads_w_static
]
);
}
| 02:00:01 |
| Diego Reis joined the room. | 02:58:44 |
Epic Eric | For the record, this is my (somewhat) cleaner build derivation (still need to add Linux building and separate the build phase into two)
let
sources = import ./npins;
pkgs = import sources.nixpkgs {
overlays = [ (import sources.rust-overlay) ];
};
inherit (pkgs) lib stdenv;
pkgs-cross-mingw = import pkgs.path {
crossSystem = {
config = "x86_64-w64-mingw32";
};
};
mingw_w64_cc = pkgs-cross-mingw.stdenv.cc;
mingw_w64 = pkgs-cross-mingw.windows.mingw_w64;
mingw_w64_pthreads_w_static = pkgs-cross-mingw.windows.pthreads.overrideAttrs (oldAttrs: {
configureFlags = (oldAttrs.configureFlags or [ ]) ++ [
"--enable-static"
];
});
rust = pkgs.rust-bin.stable.latest.default;
rustCc = pkgs.rust-bin.stable.latest.default.override {
targets = [ "x86_64-pc-windows-gnu" ];
};
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./godot
./rust
];
};
commonArgs = {
version = "0";
inherit src;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit src;
sourceRoot = "${src.name}/rust";
hash = "sha256-kRZdndknulrZFeb7EDwNrpctjaT/UreFwZREOxv7e08=";
};
cargoRoot = "rust";
postPatch = ''
export HOME=$(mktemp -d)
mkdir -p ~/.local/share/godot
ln -s ${pkgs.godot_4_5-export-templates-bin}/share/godot/export_templates ~/.local/share/godot/export_templates
'';
};
commonArgsWin = commonArgs // {
RUSTFLAGS = (
map (a: ''-L ${a}/lib'') [
mingw_w64
mingw_w64_pthreads_w_static
]
);
buildInputs = [
pkgs.rustPlatform.cargoSetupHook
mingw_w64_cc
rustCc
];
};
in
{
windows-release = stdenv.mkDerivation (
commonArgsWin
// {
pname = "crane-game-windows-release";
buildPhase = ''
${rustCc}/bin/cargo build --target x86_64-pc-windows-gnu --release --manifest-path ./rust/Cargo.toml
mkdir ./export_windows
${pkgs.godot_4_5}/bin/godot --headless --path ./godot --export-release "Windows Desktop" ../export_windows/CraneGame_win.exe
'';
installPhase = ''
mkdir $out
cp ./export_windows/* $out
'';
}
);
}
| 12:43:23 |
Pol | I always forgot about the Nix Rust room! | 13:08:59 |
Pol | I posted this (https://gist.github.com/drupol/41bef4037d1d4c116f5ffa6df6493e28) in the main Nix room, but I guess I should have posted it here. | 13:09:20 |
Pol | I'm trying to understand why overriding oldAttr.cargoDeps does not work. Can you help ? | 13:09:45 |
| wilhelmines joined the room. | 16:55:35 |