NixOS on everything
S403 | Fri 22 Jan 11:40 a.m.–12:25 p.m.
Presented by
-
Brian McKenna
@puffnfresh@mastodon.social
@puffnfresh
https://brianmckenna.org/
Brian McKenna is an infrastructure and platform engineer at Obsidian Systems, where he runs blockchain validator infrastructure on NixOS. He has contributed to Nix, PureScript, Scala and Idris, and previously spent years at Atlassian, as a Principal Developer. He lives in northern Tasmania, where he puts NixOS on everything he can.
Brian McKenna
@puffnfresh@mastodon.social
@puffnfresh
https://brianmckenna.org/
Brian McKenna is an infrastructure and platform engineer at Obsidian Systems, where he runs blockchain validator infrastructure on NixOS. He has contributed to Nix, PureScript, Scala and Idris, and previously spent years at Atlassian, as a Principal Developer. He lives in northern Tasmania, where he puts NixOS on everything he can.
Abstract
I'm a tyrant when it comes to hardware that I purchase. I specifically look for devices which I think I'll be able to hack and run my own software on. If it has firmware, I want to reprogram it.
Look around and you'll often find hacks for various devices. But these tend to go stale once the author moves on to their next target. That bitrot means the next potential hacker gets stuck untangling scripts and doing archaeology on whatever the toolchain happened to look like the year the hack was published.
I've been using Nix and NixOS for over a decade. It provides tools for declaring software builds and making them reproducible. If you've ever tried to set up a cross-compilation pipeline by hand, you'll know it's a world of pain. It's also something Nix does very easily.
I'll walk through the whole path. The concrete criteria I apply before buying, and the signals that tell me a device will fight me. Finding or writing a working device tree, and hunting down the kernel patches that make the hardware whole. Then packaging all of it into a bootable NixOS image and getting it onto the device.
Then I'll show you the results: the various weird devices I run my own version of NixOS on, including mobile phones, games consoles and e-readers. At least one demo will involve making a device do something its manufacturer never intended. And I'll show how I can compile years-old branches of my operating system today, without even having to think about it.
You'll hopefully leave with a different criterion for choosing hardware: whether you'll be able to make it fully yours. And with a sense of how useful reproducibility is outside a CI system, as a way of encoding knowledge that survives after people move on from a project.
I'm a tyrant when it comes to hardware that I purchase. I specifically look for devices which I think I'll be able to hack and run my own software on. If it has firmware, I want to reprogram it.
Look around and you'll often find hacks for various devices. But these tend to go stale once the author moves on to their next target. That bitrot means the next potential hacker gets stuck untangling scripts and doing archaeology on whatever the toolchain happened to look like the year the hack was published.
I've been using Nix and NixOS for over a decade. It provides tools for declaring software builds and making them reproducible. If you've ever tried to set up a cross-compilation pipeline by hand, you'll know it's a world of pain. It's also something Nix does very easily.
I'll walk through the whole path. The concrete criteria I apply before buying, and the signals that tell me a device will fight me. Finding or writing a working device tree, and hunting down the kernel patches that make the hardware whole. Then packaging all of it into a bootable NixOS image and getting it onto the device.
Then I'll show you the results: the various weird devices I run my own version of NixOS on, including mobile phones, games consoles and e-readers. At least one demo will involve making a device do something its manufacturer never intended. And I'll show how I can compile years-old branches of my operating system today, without even having to think about it.
You'll hopefully leave with a different criterion for choosing hardware: whether you'll be able to make it fully yours. And with a sense of how useful reproducibility is outside a CI system, as a way of encoding knowledge that survives after people move on from a project.