NixOS support for Balena

NixOS is an OS and an ecosystem featuring declarative management of packages and the system configuration via Nix’ purely functional programming language. NixOS makes it possible to configure a whole fleet of servers from A to Z via a single source of .nix files. Nixpkgs is where most of the packages and common services’ declarations are used. Docker containers became redundant to me, when I got familiar with Nix’ multiple versions / variants support for packages, and NixOS’ systemd support which in turn provides containerizing services - if you can configure a package’s dependencies from the ground up, and define a service to run it in a protected environment, what else docker can give you?

Here are more examples and features.

BalenaOS implements the idea of managing multiple services from a single git repository, and makes it wonderfully easy to deploy changes via a git push / balena push.

I came to use BalenaOS since unfortunately NixOS’ support for ARM is experimental and currently dissatisfying. Additionally, Balena is generous enough to allow me to build images on the cloud, and only then deploy them to my devices. Using Nixpkgs’ cross compilation tools, or an emulated qemu based builder on my desktop, would require me computing resources & time I don’t posses, due to the lack of binary caches of Nix packages1.

Balena is awesome and NixOS is too. Both ecosystems integrated are a match made in heaven in my view. Would be happy to hear your opinions! :beers:.

Thanks for the info Doron! We have started to explore and learn about NixOS a bit in our general R&D, and as you mention many of the concepts are rather complementary. While we don’t have any official or formal plans for inclusion or migration to NixOS, it’s something we are aware of and watching carefully. :slight_smile:

1 Like

Lately announced on NixOS’ Discourse forum, A new project named system-manager strives to allow the usage of Nix’ packages and the NixOS module system to install services on non-NixOS systems:

This is particularly interesting in reference to the idea proposed here: With a single Docker image, one can define with this tool all the services they need using Nix and Nixpkgs - with all of the features this includes. Haven’t really given this a try yet, but it’s certainly looks promising.