Nix Rust | 683 Members | |
| Rust | 155 Servers |
| Sender | Message | Time |
|---|---|---|
| 18 Mar 2025 | ||
| why is it so hard for upstreams to commit their lockfiles is beyond me | 10:42:49 | |
| I'm guessing in this case it's because the ./below/Cargo.toml file was not next to the ./Cargo.lock file, and they only commited changes to the ./below directory | 11:02:18 | |
| 19 Mar 2025 | ||
| There may be an issue with rust bindgen packaging (or an issue with rust bindgen itself) At first I thought meson is hanging but after some investigation I figured out bindgen is hanging because it’s trying to run llvm-config. Which because it’s a cross compile, is an x86_64-linux binary. Instead of running llvm-config-native. Once I set LLVM_CONFIG_PATH variable the build succeeded. I don’t think that should be happening? Part of it is probably that I have misconfigured binfmt and running x86 binaries hangs, but bindgen should by default run llvm-config-native when cross compiling, right? Instead of trying to run llvm-config, which in this case is compiled for the wrong architecture | 10:56:11 | |
| 22 Mar 2025 | ||
| what is the most popular Rust library for working with Nix? I am teaching myself Rust and I want to build a thing that can read from an OCI registry and write to the Nix Store.. with an eventual goal of maybe allowing the OCI registry to be used for substitution... but these are all kind of lofty goals.. I am very much a Rust novice.... this seems simple to do but I don't know what I don't know. I've already got a thing hobled together allowing me to write arbitrary files to an OCI registry.. | 15:33:04 | |
| You'll really want to go through libstore for this | 15:33:56 | |
| Via rust-cxx or sometihg | 15:34:17 | |
| * Via rust-cxx or something | 15:34:19 | |
Or just call nix-store --add-fixed or whatever | 15:34:29 | |
| ok i'll check that out thanks... ahh thats a good idea.. | 15:34:43 | |
| But really the big problem would be actually making the planner aware of other types of substituters | 15:34:55 | |
| You'd have to write your own store subclass and that's C++ | 15:35:04 | |
| Even Lix doesn't have enough Rust infrastructure to do that in Rust | 15:35:19 | |
| sounds like a learning opportunity | 15:35:27 | |
| But also I'd argue there's a pretty big impedance mismatch between OCI semantics and Nix stores | 15:35:59 | |
| my short term goal would simply be hey can I take a registry layer and store it in Nix and it be equivalent to something built purely with Nix. | 15:36:09 | |
| Nix doesn't really need anything the OCI spec provides | 15:36:12 | |
| Except copying blobs around | 15:36:21 | |
| yea I would be treating the OCI registry as a blob store.. | 15:36:34 | |
| And there are significantly easier ways to copy blobs around | 15:36:48 | |
| the idea being that I would be able to leverage existing infra for storing Nix stuff because everyone already talks OCI registry.. so I could store it there and then have a thing that pulls it down.. to a local Nix store.. maybe making it easier for air gapped environments or just playing nice with places that don't do Nix | 15:37:57 | |
| I feel like S3, which already exists, is kind of that already? | 15:38:16 | |
| oh yea I actually didn't know you could store Nix store in S3 | 15:38:32 | |
| You can and it is in fact how cache.nixos.org works | 15:38:42 | |
| my inspiration kind of came from nix-snapshotter.. but it depends on Nix to be available on the host... I thought maybe something like this would allow to decouple that requirement. I don't know this all my might be just an academic exploration to teach me Rust.. thank you for the knowledge | 15:42:19 | |
| gumby0811: it depends where you want to sit in the stack. If you just want to make something that Nix can substitute from and copy NAR files to that is pretty simple. You either implement two types of endpoints on a HTTP server or S3 server. Most binary caches do this. If you want to talk to the Nix daemon directly or want to implement a remote builder of some kind you need the daemon protocol and no complete implementation of that exists in Rust. Harmonia has some client stuff, Snix/Twix has some server stuff, Tweag did a nix-remote crate that also implements some of it and Gorgon can work as a proxy so has some client an server stuff. Lastly I would be remiss to not mention my own implementation of some of the daemon protocol Nix.rs. | 16:41:48 | |
| If you need to make NAR files on the fly or need to read an write them there is a sync impl on crates last I looked and i know that Snix has sync and async impls and Nix.rs has an old async one. | 16:45:00 | |
| For a HTTP cache that makes NAR files on the fly you would also need to deal with Narinfo files. Snix has a parser for them but it is a pretty simple text format in the style of "key: value\n" | 16:48:26 | |
| thanks! | 17:19:34 | |
| 21:25:44 | ||
| 23 Mar 2025 | ||
In reply to @tomasajt:matrix.org Looking for some feedback on this. It un-breaks a few packages, including rustdesk* | 10:37:54 | |