New applications within Sevalla always use the latest recommended Nixpacks. Sometimes, this may cause changes to the build process; it is your responsibility to keep up-to-date with the latest changes by checking the Nixpacks changelogs for your application’s language. You can check and change the Nixpacks version your application uses within Settings > Build > Update settings.
Supported languages
Nixpacks supports the following languages:- Clojure
- Cobol
- Crystal
- C#/.NET
- Dart
- Deno
- Elixir
- F#
- Go
- Haskell
- Java
- Lunatic
- Node.js
- PHP
- Python
- Rust
- Swift
- Scala
- Zig
If you do not specify a version in your application’s code, Nixpacks will use the current default version. If you have a PHP application with a composer.json file in the repository, it must include a require key with a PHP version. For more details on how to specify the PHP version, see Set a Nixpack’s Language Version below.
Configure Nixpacks
Some applications require no configuration, but some require specialized commands and options to run, such as: Environment variables — You may need to set certain environment variables to run your application. Processes — Sevalla can automatically detect your web process command. You can change this if required, and you can define additional processes. Processes in a Procfile — You may want to define your processes in a Procfile within your application’s code.Configure builds
By adding anixpacks.toml
file to your repository, you can customize the final Docker image generated by Nixpacks. This configuration file allows you to specify additional providers, install extra packages, customize your build commands, override the start command, and even define new build phases, giving you greater control over the build process and the resulting image.
For more information about how to configure the nixpacks.toml
file, refer to Nixpack’s documentation.
Nixpacks and pnpm
If you use pnpm with Nixpacks, you must use the following location forPNPM_HOME
:
Nixpacks binary directories
With Nixpacks, the binary directories may differ from the default binary directories for the application language. The following table shows the binary directories used for some of the most common languages:Language | Directory |
---|---|
Node.js | /nix/var/nix/profiles/default/bin/node |
Ruby | /nix/var/nix/profiles/default/bin/ruby |
Python | /nix/var/nix/profiles/default/bin/python |
Java | /nix/var/nix/profiles/default/bin/java |
Scala | Scala doesn’t have a specific default binary path like some other compiled languages. When you compile a Scala program, it generates bytecode that runs on the Java Virtual Machine (JVM). The compiled Scala classes are typically stored in a directory structure that mirrors the package structure of your code. This is similar to how Java classes are organized. By default, when you compile a Scala source file, the compiled .class files will be placed in the same directory as the source code (within a subdirectory structure based on the package declarations). If needed, you can install Scala’s runtime tools using a Dockerfile instead of using a Nixpack. |
PHP | /nix/var/nix/profiles/default/bin/php |
Go | Go doesn’t have a specific default binary path like some other compiled languages. When you compile a Go program, the resulting binary executable is typically placed in the same directory as your source code by default. If needed, you can install Go’s runtime tools using a Dockerfile instead of using a Nixpack. |
Set a Nixpack’s language version
When you use Nixpacks, if you do not specify a version in your application’s code, the Nixpack will use the latest available version. If you want to use a different language version for your application, you’ll need to set the version in your application’s files or, depending on the language, with an environment variable. The available methods for setting the version vary by language. Below, we’ve included examples for the most common languages.Go
To specify your Go version, include the following in your application’s go.mod file:Java
To specify your Java version, set theNIXPACKS_JDK_VERSION
environment variable and make sure the variable is available during the build process.
If you’re using Gradle, to specify the version, set the NIXPACKS_GRADLE_VERSION
environment variable and make sure the variable is available during the build process.
Node.js
To specify your Node.js version, do one of the following: Include the following in your application’s package.json file:NIXPACKS_NODE_VERSION
environment variable and make sure the variable is available during the build process.
Only the major version like 14 or 14.x can be specified. The latest release under that major version will be used.
PHP
Nixpacks only supports PHP version 8.1 or higher
Python
To specify your Python version, do one of the following:- Include the following in your application’s runtime.txt file:
python-3.10.6
- Include the following in a .python-version file in your repository:
3.10.6
- Set the
NIXPACKS_PYTHON_VERSION
environment variable and make sure the variable is available during the build process.