RSSAmplifier

Blog

mt_caret's blog

mt_caret's blog

mt-caret.github.ioRSS feed ↗6 posts

Latest posts

Calling OCaml from C in dune

These are some notes on putting together a dune file for creating a C executable which calls OCaml code. The OCaml manual describes how to call OCaml code from C under the section “Advanced example with callbacks” in the chapter “Interfacing C with OCaml”, using the following invocations to ocamlopt : $ ocamlopt -output-obj -o modcaml.o mod.ml $ ocamlopt -c modwrap.c $ cp ` ocamlopt -where `…

Static site generation in dune

It’s been a while. People have suggested that I blog again, so here I am. Mostly it’s been a lack of time, but getting my static site generator working again was too painful for me to muster the energy to write anything. Let’s fix that first. Dune , the build system often used for OCaml projects, is pretty general, and you can use it as a Makefile-on-steroids. Here’s a simple dune rule for…

Bootstrapping Nix channels in NixOS

A few years after starting to use NixOS, I realized that the experience of reproducing my setup on a new machine has become harder , not easier, especially after setting up encryption and opt-in state . This is rather embarrassing, so here’s my first step in remedying that. My NixOS configuration currently depends on multiple channels ( <nixos-20.09> , <nixos-unstable> , <nixpkgs-unstable> , and…

Working Through the Jepsen Tutorial with a NixOS Container Cluster

Jepsen is a distributed system testing library which has found numerous issues with existing distributed systems . I’ve always wanted to try it out, but because it was written in an unfamiliar language 1 I couldn’t bring myself to take the plunge. A few outages and some frightening issues later with a distributed system that we run at work, I finally took some time to learn a bit of Clojure and go…

Setting up LDAP Authentication with NixOS

At work, we manage an OpenLDAP server that handles authentication and authorization for various services that we provide. All machines run Ubuntu with individual service being containerized and run in LXD. I was interested in testing some open source projects out to integrate into our infrastructure. However, finding out the convoluted installation instructions for software on Ubuntu and turning…

Encypted Btrfs Root with Opt-in State on NixOS

grahamc’s “Erase your darlings” blog post is an amazing example of what a snapshotting filesystems (zfs) combined with an immutable, infrastructue-as-code OS (NixOS) can achieve. To summarize the post, grahamc demonstrates how to erase the root partition at boot while opting in to state by getting NixOS to symlink stuff to a dedicated partition. This restores the machine to a clean state on every…