profiles {

  // detect tempdir
  tempDir = java.nio.file.Paths.get(
    System.getenv('NXF_TEMP') ?:
      System.getenv('VIASH_TEMP') ?: 
      System.getenv('TEMPDIR') ?: 
      System.getenv('TMPDIR') ?: 
      '/tmp'
  ).toAbsolutePath()

  mount_temp {
    docker.temp            = tempDir
    podman.temp            = tempDir
    charliecloud.temp      = tempDir
  }

  no_publish {
    process {
      withName: '.*' {
        publishDir = [
          enabled: false
        ]
      }
    }
  }

  docker {
    docker.enabled         = true
    // docker.userEmulation   = true
    singularity.enabled    = false
    podman.enabled         = false
    shifter.enabled        = false
    charliecloud.enabled   = false
  }
}