| 1 Dec 2025 |
Aditya Kompella | Thank you. I am planning currently to submit a PR to nixpkgs for a package I haven't seen on there, and I'll take a look at taking responsibility for other packages once I go through the process once myself, I hadn't considered that. However, I was asking more about the nix / nixos tooling / projects rather than projects in nixpkgs. | 08:34:44 |
K900 | Nixos tooling that is Rust mostly lives inside nixpkgs | 09:03:53 |
K900 | Nix itself doesn't use Rust | 09:03:58 |
K900 | Lix, a Nix fork, uses Rust somewhat, and plans for more Rust in the future | 09:04:10 |
John Ericson | See also the recent activity in https://github.com/nix-community/harmonia | 09:06:34 |
John Ericson | An all-Rust daemon should not be much more work away | 09:07:03 |
| 3 Dec 2025 |
GaƩtan Lepage | I have set cargoCheckType = "debug" and the env variable still shows "release". Are we supposed to set it as an env variable?
I saw some derivations that set cargoCheckType in their attrs... | 18:07:18 |
rosssmyth | Should work unless you are using buildRustPackage then you need to set checkType and not cargoCheckType | 18:15:44 |
| neobrain joined the room. | 21:27:05 |
neobrain | When writing a flake.nix for a Rust project I'm authoring (i.e. it'll bundle the flake), are there reasons to use anything other than nixpkgs's buildRustPackage? | 22:20:37 |
dish [Fox/It/She] | if you need a nightly or beta version then you'd be better off with an external project | 22:26:55 |
dish [Fox/It/She] | i dont have a preference personally since I dont use them | 22:27:03 |
dish [Fox/It/She] | but that's the main reason to use them | 22:27:09 |
dish [Fox/It/She] | since they have binary caches so you dont have to build rustc from source(which would happen if you overrode nixpkgs' rustc version) | 22:27:29 |
neobrain | Oh, I was thinking among the other nix options (naersk, carnix, etc) that are listed on the wiki | 22:32:52 |
rosssmyth | Yes!
- Currently if cross compiling for mingw
buildRustPackage makes it a bit worse than the other builders
buildRustPackage does no caching of dependencies. This means that every time you run nix build it will rebuild every dependency. The others generally do not to varying levels of granularity.
For projects I author I generally use Crane. You can do some smart caching so that it's pretty fast in CI.
| 22:33:06 |
neobrain | For development I'm just going to nix develop either way | 22:33:08 |
neobrain | * Oh, I was thinking among the other nix options (naersk, crane, etc) that are listed on the wiki | 22:33:42 |
neobrain | Interesting point about caching of dependencies. I would've assumed the mapping of Cargo.lock would create a separate nix store entry for each dependency (and hence trivially cache things), but I'm probably underestimating the problem space :) | 22:35:27 |
dish [Fox/It/She] | sorry, thats what I meant. I see the main value prob of the {naersk,crane,fenix,etc} solutions as being that they allow using betas/nightlys if wanted | 22:35:42 |
dish [Fox/It/She] | I'm not a rust dev but that is one of the main things I've noticed | 22:35:52 |
neobrain | Ah, gotcha | 22:36:04 |
dish [Fox/It/She] | maybe I'm wrong in that way but from my usage in the past thats been my reason to use them | 22:36:10 |
dish [Fox/It/She] | * maybe I'm wrong in that way but from my usage in the past thats been my reason to use them over buildRustPackage | 22:36:13 |
dish [Fox/It/She] | since I just use cargo during active dev | 22:36:42 |
rosssmyth | For an example of the caching, you can see what I did with Wild. Basically the assumption is "the Cargo.lock and flake.lock files do not change very often (compared to the rest of the souce)"
So there's a dedicated job that refreshes the cache when the lockfiles change Then another job for running with the cached dependencies And a cron job to periodically update the flake lockfile
| 22:37:03 |
rosssmyth | You can use nightly and beta with buildRustPackage just as easily as the other options, so I wouldn't really say that's an advantage. It's even shown in the reference how to | 22:38:21 |
rosssmyth | You just can't in Nixpkgs | 22:38:34 |
neobrain | rosssmyth: How do you handle day-to-day development? Do you enter a nix shell or do you always nix run/build? If it's purely the former, I'm guessing the main benefit of the caching is for CI? | 22:39:26 |
neobrain | * rosssmyth: How do you handle day-to-day development? Do you enter a nix shell (and then use Cargo manually) or do you always nix run/build? If it's purely the former, I'm guessing the main benefit of the caching is for CI? | 22:39:45 |