Native NixOS containers can be a lightweight alternative to the heavier Docker containers, which are already supported by Dysnomia.
The need for this new module stems from the fact that my distributed infrastructure, managed by Disnix, is built upon NixOS hosts with a configuration described by a flake, which is periodically fetched by the hosts according to their automatic update routines. With NixOS containers, it is possible to take advantage of the service definitions provided by Nixpkgs while decoupling the host configuration.nix from the services they provide.
Another use of NixOS containers is as a stop-gap measure for services for which there is still no Dysnomia module.
I tested this addition on my machine but, unfortunately, I couldn't write a test to prove that it works. For some reason, nix-env insists on downloading some data from the Internet even if I supply a fully-built derivation, and Internet connectivity is disabled for test VMs. If anyone knows how to circumvent this, I am open to suggestions.
For this reason, this PR has been opened as a draft. Nonetheless, I included the unit test that I wrote. If you try to run it, you will see that it fails as soon as nix-env attempts to download info about binary caches. If you run all the scripted commands on your local NixOS installation, they will likely succeed.
Native NixOS containers can be a lightweight alternative to the heavier Docker containers, which are already supported by Dysnomia.
The need for this new module stems from the fact that my distributed infrastructure, managed by Disnix, is built upon NixOS hosts with a configuration described by a flake, which is periodically fetched by the hosts according to their automatic update routines. With NixOS containers, it is possible to take advantage of the service definitions provided by Nixpkgs while decoupling the host
configuration.nix
from the services they provide. Another use of NixOS containers is as a stop-gap measure for services for which there is still no Dysnomia module.I tested this addition on my machine but, unfortunately, I couldn't write a test to prove that it works. For some reason,
nix-env
insists on downloading some data from the Internet even if I supply a fully-built derivation, and Internet connectivity is disabled for test VMs. If anyone knows how to circumvent this, I am open to suggestions.For this reason, this PR has been opened as a draft. Nonetheless, I included the unit test that I wrote. If you try to run it, you will see that it fails as soon as
nix-env
attempts to download info about binary caches. If you run all the scripted commands on your local NixOS installation, they will likely succeed.