nextflow-io/nextflow

Support for Pixi

Open

#6,092 opened on May 16, 2025

View on GitHub
 (3 comments) (17 reactions) (0 assignees)Groovy (784 forks)batch import
good first issuestale

Repository metrics

Stars
 (3,382 stars)
PR merge metrics
 (Avg merge 16d 9h) (54 merged PRs in 30d)

Description

New feature

Pixi is a package manager equivalent to Conda which is growing in popuarity recently.

Use case

Equivalent to Conda, Mamba, Spack, etc. We can use it to set environments per process using a Pixi TOML.

Suggested implementation

Here's a hacky version inspired by https://tiendu.github.io/2025/05/10/nextflow-pixi-eng.html. We could probably implement something similar inside a process.

main.nf:


process PIXI {

    debug true

    beforeScript '''
    [ -d .pixi ] && [ -f pixi.lock ] || pixi install
    eval "$(pixi shell-hook)"
    '''

    input:
        path pixi_lock

    output:
        stdout

    script:
    """
    cowpy "hello pixi"
    """
}

workflow {
    pixi_lock = Channel.fromPath("pixi.toml", checkIfExists: true)

    PIXI(pixi_lock)
}

pixi.toml

[project]
name = "test-pixi-env"

channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64", "win-64"]

[dependencies]
cowpy = "1.1.*"
python = "3.13.*"
N E X T F L O W   ~  version 25.04.1

Launching `./main.nf` [nauseous_hoover] DSL2 - revision: 8f2d7021a8

executor >  local (1)
[39/fcb524] PIXI (1) [100%] 1 of 1 ✔
 ______________________________________________________ 
< Cowacter, eyes:default, tongue:False, thoughts:False >
 ------------------------------------------------------ 
     \   ^__^
      \  (oo)\_______
         (__)\       )\/\
           ||----w |
           ||     ||

Contributor guide