I'm trying to configure a container within nixos containers for example:
containers.abc123 = {
config = { config, pkgs, ... }:
{
systemd.services = {
finder-email-requests = {
description = "";
enable = true;
environment = {
TESTING = "abcxyz";
};
serviceConfig = {
Type = "simple";
ExecStart = "bash -c \"echo '$TESTING hello' >> /tmp/abcxyz\"";
Restart = "always";
RestartSec = 30;
};
wantedBy = [ "default.target" ];
};
};
};
};
However needing to test/compile this means running nixos-rebuild test which can take 10+ seconds on my machine (or 7s on a newly installed VM I just tried).
Is there some way I can more quickly test this container config independent from my entire host's Nixos config? For example building just the container config itself rather than the entire instance of this nixos config?
I've found that the nixos-rebuild command is a small shell script for example at https://github.com/NixOS/nixpkgs/blob/216f0e6ee4a65219f37caed95afda1a2c66188dc/nixos/modules/installer/tools/nixos-rebuild.sh
However after reading through it, I don't quite understand whats going on in terms of the relationship between this 'containers' unit and the general 'nixos config'.