4 ms·
I've recently switched to using nix-shell and overmind with a Procfile to officially retired docker-compose from all of my projects. Such a breath of fresh air.
by bsnnkv 4y ago
I've recently switched to using nix-shell and overmind with a Procfile to officially retired docker-compose from all of my projects. Such a breath of fresh air.
Like Mitchell Hashimoto (Hashicorp), I no longer do any development on macOS directly; I have a Linux VM where all my projects live and have their environments managed with a shell.nix file. Highly highly recommend it.
- unboxingelf 4y agoWould you elaborate on the setup? I recall seeing a comment or article where Mitchell mentioned this setup previously. I’ve been using Make + Docker for development on macOS for a long time now and perhaps it’s time for a change. I’ve looked at nix once or twice over the years but it never really clicked.
- bsnnkv 4y agoSure, this is a super abbreviated version of my current setup for developing https://notado.app https://notado.app shell.nix - this brings the packages I need to develop into the $PATH when I run `nix-shell` in the repo {pkgs ? import <nixpkgs> {}}: with pkgs; mkShell { buildInputs = [ meilisearch openssl overmind pkg-config postgresql rustup tmux ]; shellHook = '' export OVERMIND_PROCFILE=Procfile.dev export PGDATA="data.pg" export MEILI_DB_PATH="data.ms" ''; } Procfile.dev - this is used to start the background services I need, the format is "name: command" postgres: postgres -K /tmp meilisearch: meilisearch Then I can run `nix-shell` to load all the dependencies and `overmind start` to bring up Postgres + Meilisearch with ignored data dirs relative to the project folder. If any of these packages need to be pinned to a specific version you can do that with this tool[1]. That's pretty much it - with all the background services running you can load your monolith or microservices with cargo/npm/etc. It's all very nice and clean! [1]: https://lazamar.co.uk/nix-versions/ https://lazamar.co.uk/nix-versions/ - I actually just used this in a new shell.nix for my personal website to pin a version of Hugo from 2019 (when I last touched it) so that it would build again
- pmarreck 4y agothis is great, and I never heard of Overmind until now (looks cool!) but you could also flake this config out and get a couple more perks, like possibly not having to use the nix-versions thing
- nerdponx 4y agoWhat do you use to run the VM? Do you try to minimize overhead at all?
- bsnnkv 4y agoMy general setup mirrors this[1] pretty closely, though of course on Windows I can just use WSL2. [1]: https://m.youtube.com/watch?v=ubDMLoWz76U https://m.youtube.com/watch?v=ubDMLoWz76U
- hamandcheese 4y agoIf you’re using nix, why are you using a VM? Nix on macOS works pretty well these days.
- bsnnkv 4y agoVMs are better for my particular use case as I am regularly shifting between my Macbook and my Windows desktop with WSL2.