Packages

The fuel.nix flake provides the following packages:

PackageDescription
fuel-coreThe Fuel VM node client.
fuel-core-clientA Fuel VM transaction client.
forcThe Fuel Orchestrator. Compiler, packaging and plugin support.
forc-clientProvides the forc deploy and forc run commands.
forc-cryptoA Forc plugin for hashing arbitrary data.
forc-debugA Forc plugin for debugging via CLI and IDE.
forc-docSway API documentation generator.
forc-fmtThe Sway code formatter.
forc-lspThe Sway Language Server Protocol implementation.
forc-txConstruct transactions with a CLI.
forc-walletA Fuel Wallet CLI implementation.
sway-vimThe Sway Vim plugin.
fuelAll of the above tools under a single package.

Running Packages

You can run any of the above programs without installing them like so:

nix run github:fuellabs/fuel.nix#fuel-core

To run the latest nightly for a package, add -nightly to the end, e.g.

nix run github:fuellabs/fuel.nix#forc-nightly

Similarly, run the version of a package from a milestone with -<milestone>, e.g.

nix run github:fuellabs/fuel.nix#forc-lsp-testnet
nix run github:fuellabs/fuel.nix#forc-wallet-testnet

Temporary Shells

To enter a temporary shell with all of the fuel packages available on $PATH, you can use the following:

nix shell github:fuellabs/fuel.nix#fuel

When you exit the shell the tools will no longer be on the PATH.

The nix shell command is useful for maintaining isolated, temporary environments and to avoid endlessly polluting your PATH with different versions. E.g. in the following, we trivially switch between a stable fuel toolchain and nightly toolchain:

$ nix shell github:fuellabs/fuel.nix#fuel

# All latest stable `fuel` packages on `PATH`.

$ exit

# No fuel packages on `PATH`

$ nix shell github:fuellabs/fuel.nix#fuel-nightly

# All latest nightly `fuel` packages on `PATH`.

$ exit

# No fuel packages on `PATH`

$ nix shell github:fuellabs/fuel.nix#fuel-testnet

# All testnet milestone `fuel` packages on `PATH`.

Installing Packages

To install fuel packages persistently for the current user:

nix profile install github:fuellabs/fuel.nix#fuel

To view whats installed for the current user:

nix profile list

To upgrade all installed packages to their latest versions:

nix profile upgrade

You can optionally specify a specific package to upgrade.

To remove an installed package:

nix profile remove 3

where 3 is the index of the package when running nix profile list.

For more options around managing nix user profiles, see the docs.

NOTE: If a previous version of Nix was installed on the system, the nix profile command may not work due to an old symlink being present in $HOME. See this issue. If you encounter this issue, you can remedy it by deleting the ~/.nix-profile symlink so that the nix profile commands can recreate it with the correct path.

Specifying Versions

To specify a specific version, append the semver or nightly date to the end:

nix run github:fuellabs/fuel.nix#forc-fmt-0-24-1
nix run github:fuellabs/fuel.nix#forc-fmt-0-24-3-nightly-2022-09-14

Note: that when building an older version or nightly, they may no longer be available in the binary cache and may need to be rebuilt!