Scaling NixOS with "Import All and Enable" Pattern

The default structure of a fresh NixOS installation makes a lot of sense, two files, which are intended to be used as the bases for future changes and represent a single machine with the bare minimum, upon which this first installation is being done. For the sake of consistent language I will call them two high level modules. The problem with "all in one configuration files" The initial installation creates two high level modules, configuration.nix and hardware-configuration.nix but what happens when we want to add zfs configuration or setup home-manger, or maybe declare neovim and emacs. The cohesion of this high level modules gets fuzzier by every such addition. Unrelated configurations get coupled together, Understating where something starts and ends and the ability to change it becomes a nightmare. ...

September 13, 2025 · Kobi Medrish

Yocto for raspberry pi4, build, boot, and cross compile

Preface The goal of this post is to customize the Yocto reference distribution, Poky to create a bootable image for the Raspberry Pi4. This involves aspects of what is often termed as “board bring-up”, specifically adapting the build system for new hardware. And will also cover cross-compilation. Choosing the Raspberry Pi4 as the target hardware for this post is deliberate decision rooted in how wide spread the use of this board for prototyping and the fact that there is already a Yocto BSP layer for it. ...

July 21, 2025 · Kobi Medrish

Building a Poky (Yocto Project) Image for QEMU

After looking at why you should build your own distribution in Rolling you own Linux distro with Yocto, And then looking on how bitbake works, it is time to dip our toes in the water and create first real image out of poky reference repository and actually run it using a virtual machine. Prerequisites I will be using Ubuntu 24.04.2 LTS, and will have about 100G of free space. Install required packages: sudo apt install liblz4-tool gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm Clone poky which is the Yocto reference distribution(walnascar branch): git clone git://git.yoctoproject.org/poky -b walnascar ~/poky Poky directory overview After cloning the poky repository a directory with the following files will be produced: ...

July 16, 2025 · Kobi Medrish

Hands-On Introduction to BitBake

Preface This post is based on a tutorial by Harald Achitz. As I was following it I was adding notes to it for context, and clarity. Filling in the blanks I came across and refactoring the structure for readability. If you haven’t yet read Rolling you own Linux distro with Yocto you should pause and start with it as it is a good intro into Yocto and goes over what it is and why use it. ...

July 9, 2025 · Kobi Medrish

Rolling you own Linux distro with yocto

This post is the first in a series that will cover embedded development from the perspective of OS development, starting with the need of such solution, the moving parts, the basic configuration that can be used on a raspberry pi and anything else that might be relevant. When it comes to starting an embedded project, one that uses more then a simple micro controller, a choice how much control over its software components will need to be made, meaning control over the OS(Linux in the context of this post) and the added logic/responsibility during development. Such control will come at the expense of development velocity(mostly at the very start of it), with the control requirements from a hubby project/POC are different then the once from production project. The former is one of a kind you can tinker with until it works and is thrown into the bowels of your basement server rack while the latter needs to be easily deployed, scaled, developed, patched and maintained. ...

October 27, 2024 · Kobi Medrish