| 2 Nov 2025 |
| yoquec joined the room. | 12:05:00 |
| @dawnofmidnight:catgirl.cloud changed their display name from whispers to whispers (it/fae). | 17:58:07 |
| amadaluzia joined the room. | 22:29:53 |
| 3 Nov 2025 |
| @kttns0ut:matrix.org joined the room. | 10:14:55 |
crop | is there a declarative alternative to cargo install? | 10:15:23 |
@acidbong:envs.net | In reply to @crop_tech:matrix.org is there a declarative alternative to cargo install? write a recipe with rustPlatform.buildRustPackage and nix build it
except it's not an alternative, it's a Nixpkgs builder exactly for Cargo | 10:21:31 |
crop | i am trying to build rustfilt with this:
rustfilt = pkgs.rustPlatform.buildRustPackage rec {
pname = "rustfilt";
version = "0.2.1";
src = pkgs.fetchCrate {
inherit pname version;
sha256 = "sha256-Xo6qM2qdzkvoLkOsxksKdpi1rkpBKPGrPxz4zJ3EVyY=";
};
cargoHash = "";
cargoDepsName = pname;
};
but the problem is that the package doesn't contain a cargo lock file so it fails in fetch-cargo-vendor-util
| 11:26:41 |
crop | i tried to use the src from github but i now run into this problem: https://github.com/NixOS/nixpkgs/issues/392872 | 12:41:11 |
crop | ok solved by switching to master and not use the taged version | 12:49:36 |
@acidbong:envs.net | In reply to @crop_tech:matrix.org
i am trying to build rustfilt with this:
rustfilt = pkgs.rustPlatform.buildRustPackage rec {
pname = "rustfilt";
version = "0.2.1";
src = pkgs.fetchCrate {
inherit pname version;
sha256 = "sha256-Xo6qM2qdzkvoLkOsxksKdpi1rkpBKPGrPxz4zJ3EVyY=";
};
cargoHash = "";
cargoDepsName = pname;
};
but the problem is that the package doesn't contain a cargo lock file so it fails in fetch-cargo-vendor-util
fetch the crate (or clone the repo), generate the lockfile (cargo generate-lockfile), put the lockfile in your nix config and change cargo* attrs to cargoLock.lockFile = ./Cargo.lock; | 13:06:25 |
Makuru 📞(WAAF / 4850) | Why does rustc build for me but fenix not? | 15:35:46 |
Makuru 📞(WAAF / 4850) | Here the flake: | 15:36:16 |
Makuru 📞(WAAF / 4850) | Download flake.nix | 15:36:16 |
Makuru 📞(WAAF / 4850) | What brakes me is that the shell isnt working but the package does? | 15:37:21 |
Makuru 📞(WAAF / 4850) | Here the error:
= note: "cc" "-m64" "/tmp/nix-shell.dAjGsj/rustcl8zW27/symbols.o" "<3 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/nix-shell.dAjGsj/rustcl8zW27/raw-dylibs" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/framework-16/Documents/ALVR/target/debug/build/serde-77f00400c2754ee5/build_script_build-77f00400c2754ee5" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-Wl,--push-state,--no-as-needed" "-lwayland-client" "-lxkbcommon" "-Wl,--pop-state"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: Could not start dynamically linked executable: /nix/store/r375wnhlcgs833kc7jcdimsn4ch8niyq-rust-mixed/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ld.lld
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
clang: error: unable to execute command: No such file or directory
clang: error: linker command failed due to signal (use -v to see invocation)
error: could not compile `serde` (build script) due to 1 previous error
| 15:37:45 |
Makuru 📞(WAAF / 4850) | Huh? what why? | 15:38:58 |
Makuru 📞(WAAF / 4850) | Why it starting a non linked but linked bin, from the nix store? | 15:39:27 |
Makuru 📞(WAAF / 4850) | Why does it work with rustc but not with fenix? | 16:05:10 |
Makuru 📞(WAAF / 4850) | Where does rustc change stuff? | 16:05:26 |
dacid44 | How do I manage binaries from crates.io with nix? like, stuff I'd usually install by running cargo install cargo-make | 16:51:26 |
dacid44 | if it matters, I'm currently using fenix for my Rust toolchain | 16:53:28 |
dacid44 | also, was cargo-make removed from nixpkgs? I have an old project that pulls it from nixpkgs just fine, but it doesn't appear to exist there anymore | 16:58:16 |
dacid44 | * also, was cargo-make removed from nixpkgs? I have an old project that pulls it from nixpkgs (24) just fine, but it doesn't appear to exist there anymore | 16:58:27 |
Ben Sparks | well ideally they'd be packaged in nixpkgs, so just an install like any other | 16:58:32 |
dacid44 | * also, was cargo-make removed from nixpkgs? I have an old project that pulls it from nixpkgs (24.05) just fine, but it doesn't appear to exist there anymore | 16:58:34 |
dacid44 | cargo-make seems to have been removed from nixpkgs | 16:59:16 |
dacid44 | * cargo-make seems to have been removed from nixpkgs? | 16:59:35 |
ghpzin | Still there on current master, search.nixos.org is just having problems. | 17:01:21 |
dacid44 | ah. Yeah I just tried it in my home-manager config and it worked | 17:01:40 |
dacid44 | in general though, how would I do that for something that hasn't been packaged already? Do I have to fully package it myself, or is there a way to just plug in the name on crates.io and maybe a rust toolchain derivation or something and have it be built and installed as if by cargo install? | 17:04:42 |