!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

680 Members
Rust154 Servers

Load older messages


SenderMessageTime
31 Jan 2022
@bernardo:matrix.parity.iobernardo changed their profile picture.11:49:58
1 Feb 2022
@aktaboot:matrix.orgaktaboot joined the room.12:03:06
@coolshaurya:community.rscoolshaurya joined the room.16:47:51
3 Feb 2022
@ultranix:matrix.orgtgunnoe changed their display name from ultranix to tgunnoe.13:34:10
@ereslibre:matrix.orgereslibre set a profile picture.20:23:04
4 Feb 2022
@withoutwithin:matrix.orgXe Iaso changed their display name from Xe to Xe Iaso.00:44:02
@marius851000:newsmatrix.pmdcollab.orgmarius851000 joined the room.12:46:53
5 Feb 2022
@js:ukvly.orgJulian Stecklina changed their display name from julianst to Julian Stecklina.10:26:08
6 Feb 2022
@mixedCase:matrix.orgAndrés Rodríguez joined the room.18:24:15
@mixedCase:matrix.orgAndrés RodríguezHey everyone. I'm trying to start a Rust project and would like to have Nix working from the start. Is there any boilerplate for this that's more up to date than https://github.com/srid/rust-nix-template?18:26:38
@tomberek:matrix.orgtomberek Andrés Rodríguez: there is a template here as well. We'd like to improve the quality of them so that this becomes the quick/easy answer for anyone beginning a Rust project. Please file an issue (or PR!) in that repo with anything you learn so we can improve. 19:19:00
@tomberek:matrix.orgtomberek(https://github.com/NixOS/templates/blob/master/rust-web-server/flake.nix)19:19:55
@mixedCase:matrix.orgAndrés Rodríguez
In reply to @tomberek:matrix.org
Andrés Rodríguez: there is a template here as well. We'd like to improve the quality of them so that this becomes the quick/easy answer for anyone beginning a Rust project. Please file an issue (or PR!) in that repo with anything you learn so we can improve.
Thank you! I see two templates there. rust-web-server and rust. The rust one I see is Naersk-based, and Naersk's very own Flakes example fails to execute nix run. rust-web-server seems to be using https://github.com/edolstra/import-cargo, hadn't heard of that!. I'll give it a go. Flake looks a bit complex for my needs and does some duplication seemingly to not use flake-utils, but I'll see what I can trim :D
19:24:49
@mixedCase:matrix.orgAndrés RodríguezJust tried using it, doesn't seem to work with nix run either :(19:30:29
@tomberek:matrix.orgtomberekthere's a bit of churn in the rust2nix tooling at the moment. i've been meaning to look into it......19:30:59
@mixedCase:matrix.orgAndrés RodríguezThat's unfortunate. I'll see if I can get away with a devShell to get development going and maybe take a stab at it again in the future. Thanks for the info though!19:32:36
@mixedCase:matrix.orgAndrés RodríguezWell, I got stubborn again. Naersk does work with nix run. But absolutely everything involved must be in version control. I'm assuming it's the same reason why Nix flakes don't work unless staged and I will never stop hating that about them :) At least got it to work!19:46:05
8 Feb 2022
@akadude:matrix.orgakadude joined the room.02:08:26
@akadude:matrix.orgakadudeHey, I am coming from here: https://github.com/oxalica/rust-overlay/issues/72. How do I use nightly channel? Here is my default.nix: https://gitlab.com/aka_dude/lobsters-best-bot/-/blob/nix-build/default.nix02:10:02
@akadude:matrix.orgakadude set a profile picture.02:10:20
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @akadude:matrix.org
Hey, I am coming from here: https://github.com/oxalica/rust-overlay/issues/72. How do I use nightly channel? Here is my default.nix: https://gitlab.com/aka_dude/lobsters-best-bot/-/blob/nix-build/default.nix

For buildRustPackage, do something like:

let
  pkgs = ...;
  pinnedRust = pkgs.rust-bin.xxx;
  rustPlatform = pkgs.makeRustPlatform {
    rustc = pinnedRust;
    cargo = pinnedRust;
  };
in rustPlatform.buildRustPackage {
  ...
}
02:30:01
@akadude:matrix.orgakadude This works! General question: is there a place where I can find full documentation on these things? Like, if I was writing a buildscript in Shake, haddock+official tutorial would be pretty much everything I need. But in Nix's case, even https://nixos.org/manual/nixpkgs/stable/#compiling-rust-applications-with-cargo doesn't say anything about makeRustPlatform and what kind of keys it accepts. Ideally, I think, I want typed documentation :) 11:01:35
@akadude:matrix.orgakadude Also, the manual mentions carnix, but you didn't. Is there something wrong with it? I want to give it a try, since my current default.nix doesn't cache at all 11:06:58
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @akadude:matrix.org
This works! General question: is there a place where I can find full documentation on these things? Like, if I was writing a buildscript in Shake, haddock+official tutorial would be pretty much everything I need. But in Nix's case, even https://nixos.org/manual/nixpkgs/stable/#compiling-rust-applications-with-cargo doesn't say anything about makeRustPlatform and what kind of keys it accepts. Ideally, I think, I want typed documentation :)
Sadly the documentations can be pretty hit-and-miss and you often need to read the soruces. In this case I think it's very valuable to have some docs for makeRustPlatform and you can send a PR.
17:35:29
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @akadude:matrix.org
Also, the manual mentions carnix, but you didn't. Is there something wrong with it? I want to give it a try, since my current default.nix doesn't cache at all
I think it was one of the earlier attempts and no longer maintained: https://github.com/nix-community/carnix
17:36:33
9 Feb 2022
@drupol:matrix.orgPol
In reply to @mixedCase:matrix.org
Hey everyone. I'm trying to start a Rust project and would like to have Nix working from the start. Is there any boilerplate for this that's more up to date than https://github.com/srid/rust-nix-template?
yes ! https://github.com/tkellogg/dura <- see there the flake.nix. Also, if you would like to hack into rust in a few minutes from any Nix powered machine, just do: nix develop github:loophp/rust-shell#stable-default
17:41:52
@drupol:matrix.orgPolFind more documentation about loophp/rust-shell here: https://github.com/loophp/rust-shell17:43:56
@mixedCase:matrix.orgAndrés Rodríguez
In reply to @drupol:matrix.org
yes ! https://github.com/tkellogg/dura <- see there the flake.nix. Also, if you would like to hack into rust in a few minutes from any Nix powered machine, just do: nix develop github:loophp/rust-shell#stable-default
Oooh! Thanks for looping me in! So that means naersk is now fully deprecated by this nixpkgs module?
17:44:36
@drupol:matrix.orgPolYou're welcome! About Naersk, I never said that :)17:44:58
@drupol:matrix.orgPolI don't even know if it is or not.17:45:08

Show newer messages


Back to Room ListRoom Version: 6