Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.