HNHacker News
TopNewBestAskShowJobs

alexykn

146 karma · joined April 22, 2025

submissionscomments
alexykn··on I built whi for super simple path management (Unix)
Problem: My path is a mess and I got annoyed with cargo / different toolchains etc. often being the wrong executables

I also am building a package manager on the side so swapping between having it's bin directory and homebrew's be up top in PATH is a concern

This thing is my solution, maybe someone wants to take a look :D

It lets you list all paths for an executable with their indices and then swap, move or "prefer" paths based on index

For managing the path with it the shell integrations are a must

alexykn··on Sapphire: Rust based package manager for macOS
I know nix, did use nix-darwin for a while and actually integrated my own scripts called from the flake into setting up my system xD
alexykn··on Sapphire: Rust based package manager for macOS
love uv <3 I will look into integrating that. Have not decided if and how to implement my own packaging / source build dsl though and will probably open a git poll for that the coming days
alexykn··on Sapphire: Rust based package manager for macOS
on github xD
alexykn··on Sapphire: Rust based package manager for macOS
Yeah, this would 100% be feasible. Great idea. It's during the week now so I don't have much time besides work.

I'll probably open a Poll on git within the next couple days about what to do about a real from source packaging system with it's own dsl, maybe just yaml/toml or something a bit more powerful like lua with mlua. No matter the choice of packaging apporach I would like to keep the generated packages "bottle compliant" -> at least with the json api spec, since this also installs from there.

There seems to be at least some in my project so even though I am very opinionated on a lot of things I don't think I should decide on that completely alone, especially given that this is the first time I play with packaging.

alexykn··on Sapphire: Rust based package manager for macOS (Homebrew replacement)
I'll add manual override flags and also let users not only build from source from formulae but any dir on their machine they want, only makes sense
alexykn··on Sapphire: Rust based package manager for macOS (Homebrew replacement)
command: why install htop, -> install start: because you wan' it -> done: you got it

Something like that you mean?

alexykn··on Sapphire: Rust based package manager for macOS (Homebrew replacement)
I know, probably will, also feel typing out sapphire for the command all the time is annoying + sapp would be weird. For me technical implementation comes first though. I'll do that when something comes to mind
alexykn··on Sapphire: Rust based package manager for macOS
Initial idea for this really came from my dayjob too, we have macs but no way to centrally manage them. The client / server part for the declarative system manager I want to build on top of this is quite far out yet though. At least several months
alexykn··on Sapphire: Rust based package manager for macOS
Anyway, please do not expect progress to be too rapid. I have a full time job and do most work on this on weekends. I fully intend to make it a stable, "finished" (as much as this is possible in software) thing, it will take a while though. If anyone want's to help out I do open the bugs I find as Issues to keep track and give people an idea of things that do not work. Good Night!
alexykn··on Sapphire: Rust based package manager for macOS
Some reason I just died laughing. Really struggled with all that stuff while building this, just seemed to make no sense in the beginning. Maybe I should do /opt/sapphire/cave, opt/sapphire/cove and opt/sapphire/quarry for mine haha
alexykn··on Sapphire: Rust based package manager for macOS
Looked at that. I do not really think implementing something like artichoke or rutie would be a good idea. I do not want my project to become overly bloated and to achieve my real goal of a declarative system management thing I think sticking to bottles (that cover almost all formulae thanks to the amazing homebrew community) and casks, getting those to work 100% is the better approach. Thank you for the suggestion though!
alexykn··on Sapphire: Rust based package manager for macOS
I will probably change the terminology at some point for this. For initially building it it is way easier to keep them the same though as trying to understand brew itself (at least for me) isn't so straight forward. It's a massive project
alexykn··on Sapphire: Rust based package manager for macOS
Building from source, obviously, will never be really that much more performant as it mainly relies on the underlying build systems and things like ninja, cmake, cargo etc. are usually optimized very very well.

Thanks to rust just being (slightly, significantly? no idea about ruby's speed) faster + concurrent downloading & pouring of bottles, most "regular" formula installs feel a good bit faster than brew already. Mainly noticeable when installing multiple formulae at once.

Casks, especially those with pkg installers, seem to profit a bit less here.

Performance was a reason, not the main one though, like I said I wanted and still want, to build a declarative package + system managing solution on top. The idea was to get into rust with that. Imo having the base written in the same language instead of wrapping commands also gives more flexibility there.

Another reason is that I never liked the way brew looks and feels. Right now the ui/ux for Sapphire is far from finished, more like a clusterf*k and only the search command really looks the way I want it. Aiming for something modern, clean and information rich without beeing overly verbose. I really like dnf5 and what AerynOS is doing and will probably take some inspiration there.

Like mentioned, Bottles and Casks should be 100% doable and that would cover most package needs on macOS, I do not see why I should also define a new repo and packaging ecosystem when such a big and popular one exists.

Source build capability will probably stay(for easy integration of source building in the system management part later) but not be focused on brew formulae as the ruby dsl would be a horror to parse.

Well and sh*t I am not trying to compete really. This is the first time building something with rust and I really really had no idea what a giant never ending rabbit hole macOS package management is and how massive and complex Brew is.

This went from should I to can I pretty quick for me xD

alexykn··on Sapphire: Rust based package manager for macOS
Hey, so I built this thing, most of it at so far at least. And yeah, right now it isn't doing many things better than Homebrew.

Setting of relative paths for bottle installs is still not perfect, well it works for every bottle I have tested except rust. Getting bottles working 100% is very doable though imo.

Build from source formulae is still pretty f*ed + I do not know if it is really feasible given that the json API lacks information there and a full on Ruby -> Rust transpiler is way out of scope. Will probably settle for automatic build system detection based on archive structure there. + Maybe do my own version of the .rb scripts but in a more general machine readable format, not .rs lol

Casks seem to work but I have only tested some .dmg -> .app ones and .pkg installers so far though. As with bottles 100% doable.

Given that almost all formulae are available as bottles for modern ARM mac this could become a fully featured package manager. Actually didn't think so many people would look at it, started building it for myself because Homebrew just isn't cutting it for what I want.

Started working on a declarative package + system manager for mac because I feel ansible is overkill for one machine and not really made for that and nix-darwin worms itself into the system so deep. Wrapping Brew commands was abysmally slow though so I started working on this and by now I am deep enough in I won't stop xD

Anyway I am grateful for every bug report, Issue and well meaning pull request.