Skip to main content
This guide walks you through layering a default environment with a project’s environment.

Create your default $HOME environment

First, create your default environment by following default environment tutorial.

Install packages

Now let’s flox install tools that will be useful on any system regardless of the project. Here we are installing curl, gitFull, gnupg, inetutils, tree, and vim.
Let’s inspect the contents of the environment with flox list:
We can test the environment is working properly with flox activate.
Everything is working!

Layering a project environment

Now that we have our tools in the default environment we can layer on a new environment that brings in project-specific dependencies. For this example we will use a publicly accessible Node project called material-ui. Let’s clone the example project to our home directory and enter the project’s directory:
Use flox init from the material-ui directory that we are in.
This project only requires yarn so let’s install it with flox install.
Now we’re ready to do development on this project! Let’s activate the material-ui Flox environment and start material-ui’s development server.
We now have access to both the dependency this project needs (yarn) and the tools we need to do development on any project (vim, git, etc)! You can layer as many environments as you want. If two environments contain the same package, Flox will use the package from the last environment activated. You can use flox envs to see the environments you have activated.

Where to next