Replies: 1 comment 3 replies
-
I understand what you're saying. To be very honest, I really have 0 experience with nix so I don't have any clue on this would work. I think we should split the development aspect and the usage aspect. For development of dora ( the project )dora is 100% a rust project meaning that everything is managed by cargo. So basically, we want to use it with:
And normally, finger crossed, everything should just compile. In this step, there is no
For usageIn a perfect world, everyone would use: cargo install dora-cli ... but... not possible... so... We have to rely on pre-compiled binary shipped on github, but need to be in Note, that this is what most rust project do... And, I agree, that it could be cleaner... better... Like, putting it in Just don't know how and don't really have the mind bandwith to do it... But ultimately yes, it should be cleaner... Is Nix the solutionI think nix is great but if you already know nix, and unfortunately, i don't think most robotist are familiar with it, so, it's hard for me to make it a first class citizen :S |
Beta Was this translation helpful? Give feedback.
-
Sorry for the clickbait title, but I feel it might actually be warranted: I'm less interested in nixos support from a "add it to the nix ecosystem" perspective, and more from the "In order to cater to nix/nixos, it's just easier to do things properly and without shortcuts" I thought that distinction might be a novel concept.
Consider my thoughts on Rust. As a language, it drives you in a direction where lifetimes are addressed, logic is encapsulated at the type level, no shortcuts taken, etc.. I found that short cut habits I developed in other languages become pain points in Rust. It compelled me to do things cleanly.
My limited experience with robotics ecosystems so far has me convinced that a sense of "do it right. do it clean. don't take shortcuts that make the ecosystem messy" isn't so prevelant. I don't believe it has to be that way. I feel like catering to the expectations of nix/nixos will help with that.
An e.g.: The installation of dora-cli
The idiomatic install-from-source is a
git clone ...
thencargo install
. With dora, instead ofcargo install
, it's a package build followed by adding the compiled binary to yourPATH
env. This is a personal hot-take, but this feels like a shortcut that makes this ecosystem feel a bit... "unclean". (sorry for the negativity).My thinking is that if the expectations of nix/nixos were catered to from the beginning, it would have surfaced this shortcut, and the project would have been forced to confront it and find a "clean" solution.
This is just one thing, but it all adds up, and the risk is for it to reach a point where using
dora
outside of docker, or a VM instance is an uncomfortable proposition.In the long run, what I'd love to see is a dev workflow that might look like this:
or:
Either of these would, in theory, set everything up to get to work. No VM, Docker, etc needed.
but here is the key idea in my mind
The benefit to the above workflow isn't in supporting nix/nixos, it's that it creates guardrails against taking the dora project in a direction where you need to isolate its use, such as with Docker or a VM. If you start relying on things like where in path your project root is, persistent environment variables, etc. This makes supporting nix complicated, and prompts you to ask yourself "is there a better way to do this?"
Beta Was this translation helpful? Give feedback.
All reactions