nix-routeros v2: A Library, Not a Framework

In March I wrote about managing my MikroTik router with Nix and the third attempt that became nix-routeros. Since then I've moved my nix-config from Snowfall to den, and the router had to move with it. v1 didn't fit, and the reasons it didn't fit turned into nix-routeros v2.

v2 is a breaking release. v1 shipped the tooling that ran your router; v2 is only the modules that describe it, and you run them with whatever you already use.

Moving My nix-config from Snowfall to den

When I wrote 1 Year on Nix, my nix-config was built on Snowfall lib. It had served me well: it gave a new Nix user a structure to follow. But as the config grew, more of my changes were working around that structure than using it, and then Snowfall itself stopped being maintained.

This month I rewrote all of it on den, an aspect-oriented framework for the dendritic pattern: my work MacBook, the home server and its test VMs, the installer image, and the Terraform stacks for DNS, the tailnet, storage, GitHub repos, and the router. This post covers why, what changed, and how I moved everything without breaking the machines I use every day.

What Is HomeAccounting?

The previous post was the why: eleven years of tracking household money, two tools that didn't survive, and the one requirement left standing at the end, that recording what you spend should cost no time at all.

This one is the what and the how. HomeAccounting is a free, open-source accounting system for households. It's AGPL-licensed, built in the open, and meant to be shaped by the people who use it, not only by me. First, what you can do with it today. Then the inside: how a transaction gets from a bank statement or a Telegram message to a balance, what happens when you correct one, and what running eventium in a real application taught me that the library's examples never did.

Why Did I Build HomeAccounting?

For eleven years I've been writing down what my household spends. One of those years was Excel. The other ten were 1C.

Neither tool survived. Both of them were right about something, and I didn't understand what until I'd lost them.

They also failed the same way, which took me most of those eleven years to see. Every tool I tried was basically a form to fill in. They competed on what happened after the data was in (the reports, the charts, the budgets), and they all assumed that getting it in was my job, in my evenings, forever. Sooner or later that bill goes unpaid. So what I set out to build was a ledger that costs no time at all.

Haskell for Scala Developers: Part 5 — Optics and Deriving

This is the least philosophical piece you could write comparing Haskell and Scala, and probably the one you'll reach for most often. It covers the two things you actually do every Tuesday afternoon: reach into a deeply nested immutable value and change one field three levels down, and get a type's boilerplate (JSON, equality, the lenses themselves) written for you instead of by hand.

Both languages solve both problems, and underneath they solve them the same way: by generating code from the shape of your types. Scala reaches for a lens library (Monocle) built on macros, and for derives clauses backed by Mirror and, when that runs out, inline/quotes. Haskell reaches for the optics ecosystem and for a deriving mechanism built on GHC.Generics, with Template Haskell as the full-power back door. The two languages end up in the same two places by different roads.

The post follows two threads: the record-update pain that makes optics worth having, and the deriving story, where Haskell's DerivingVia has no Scala equivalent at all.