Packages
The fuel.nix flake provides the following packages:
| Package | Description |
|---|---|
fuel-core | The Fuel VM node client. |
fuel-core-client | A Fuel VM transaction client. |
forc | The Fuel Orchestrator. Compiler, packaging and plugin support. |
forc-client | Provides the forc deploy and forc run commands. |
forc-crypto | A Forc plugin for hashing arbitrary data. |
forc-debug | A Forc plugin for debugging via CLI and IDE. |
forc-doc | Sway API documentation generator. |
forc-fmt | The Sway code formatter. |
forc-lsp | The Sway Language Server Protocol implementation. |
forc-tx | Construct transactions with a CLI. |
forc-call | A Forc plugin to call contracts and query the chain from the CLI. |
forc-migrate | Migrate Sway projects to the next breaking version. |
forc-publish | Publish a package to the Forc registry. |
forc-wallet | A Fuel Wallet CLI implementation. |
sway-vim | The Sway Vim plugin. |
fuel | All 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 profilecommand 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-profilesymlink so that thenix profilecommands 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!