anchor.diff:      exec "$@"
     '';
   
  -  launchHost = writeScript "launch-host" ''
  +  launchHost = host: writeScript "launch-host" ''
       #!${stdenv.shell}
  -
  -    set -x
   
       set -eu
       set -o pipefail
   
       host="$NOMAD_TASK_NAME"
  -    init="$NIXOS_NOMAD_INIT"
       root="$NOMAD_TASK_DIR/root"
       alloc="$NOMAD_ALLOC_INDEX''${NOMAD_ALLOC_ID:0:8}"
       network_zone="$alloc"
  
positive.code:       driver = "raw_exec"
        kill_signal = "SIGTERM"
        config {
          command = "${launchHost}"
        }
        env {
          NIXOS_NOMAD_INIT = "${host.nixos.out.system}/init"
          ${concatStringsSep "\n" (
            mapAttrsToList (k: v: ''${k} = "${v}"'') host.environment
          )}
  
negative.code:       --tmpfs=/var \
        --network-zone="$network_zone" \
        --kill-signal=SIGRTMIN+3 \
        "${initBinary}" "${host.nixos.out.system}/init"
    '';
  
    setupNetwork = writeScript "setup-network" ''
      #!${stdenv.shell}
  
      set -eu
      set -o pipefail
  