oliverdavies.uk/source/_posts/2025-07-22.md

1.4 KiB

date title permalink
2025-07-22 Implementing the dendritic pattern /daily/2025/07/22/implementing-dendritic-pattern

I recently started migrating my NixOS configuration repository to follow the dendritic pattern.

This is a pattern where each Nix file is its own separate standalone module.

This makes it easier to refactor and re-organise files, and allows modules to be broken into multiple files.

Rather than rewrite everything at once, I decided to take an iterative approach.

This meant refactoring modules in-place within my existing configuration, and keeping everything in a working state.

I've migrated a number of modules, and will continue working through the remaining ones as time allows.

Once I've refactored everything, I'll go through them again and see what else I can do, like splitting modules into separate smaller files.

In general, the modules I've migrated have been smaller than what I had before, partly because there's less boilerplate code needed.

And, whilst there are more files, they are smaller than before, have a single responsibility and have less indentation than before - making them easier to read and understand.