In this post I share how I switched to Debian and set up a development environment for OCaml.
As mentioned in this post, I was running NixOS on my machine, but getting it set up comfortably for OCaml seems challenging. Instead of fighting with the OS, I decided to switch to Debian because I love trying different OS, and because Debian has good support for OCaml.
Installing Debian was pretty straight forward:
- Back up data from the old OS.
- Grab the Debian installer for amd64 architecture on a USB storage device.
- With the computer off, plug in the USB storage device.
- Turn on the computer, immediately mash either DEL or F8 or F2 or ESC to get to the setup utility screen. If it gets pass to the boot screen of the old OS, press CTL-ALT-DEL and try again.
- Go to the boot tap, follow the instructions to move your USB device to the highest boot priority order.
- Save and quit the setup utility screen.
- Watch and make sure it boots from the USB. My computer was trying to network boot for some reason, and I had to remove the network boot option before it would boot from USB.
- Follow the instructions of the installer. When in doubt, consult the installation manual.
I'm really quite impressed with Debian so far. I've used it a few years back but I switched to Arch because its packages were updating too slowly. But things have really improved since! I'll have some more configuration to do (installing a tiling manager and other tools etc) but the default set up is very usable anyway.
Setting up Dev Environment for OCaml
Now that Debian is set up, following the installation instructions from Real World OCaml is super easy! I installed OPAM with apt, get OPAM set up, then install other libraries and tools with it. I'm really quite happy with OPAM!
Now, I have utop running without it complaining anything! (Yeah my setup in NixOS was a mess.) I haven't tried out much of Merlin and ocamlformat yet but I'll do so and report back.