Documentation Index
Fetch the complete documentation index at: https://flox.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Verify your downloadYou can find the
SHA256 checksums and
SHA512 checksums for
Flox 1.12.0 online.
- MacOS (Pkg)
- MacOS (Homebrew)
- Debian
- RPM
- Nix (Generic)
- Nix (NixOS)
- Container
- WSL 2
Download and install the package that matches your machine’s architecture.
Verify Flox installationIf the following command returns without error then you’re ready to get
started!The version you see might be different.Upgrades to existing Flox installationDownload and install the latest image as described above.
-
Download installer for Macs with
Apple Silicon
aarch64-darwinIntel processors
x86_64-darwin - Double-click to install the downloaded file
- Open a terminal window to continue below
This will replace an existing Nix installation
This will replace an existing Nix installation
Flox will reconfigure an existing Nix installation. These changes are designed to improve the overall user experience and make the Nix installation more reliable and easier to support, but it’s worth noting that anyone wishing to revert to a “vanilla” Nix installation after installing Flox will need to re-install Nix.If you want retain full control of your Nix installation, see the Nix (Generic) instructions.
When installing over a previous installation of Nix the Flox installation will:
When installing over a previous installation of Nix the Flox installation will:
- Back out customizations made to the following files when Nix was
installed:
/etc/bashrc/etc/bash.bashrc/etc/profile.d/nix.sh/etc/zshrc/etc/zsh/zshrc
- Overwrite the system-wide
/etc/nix/nix.conf - (If applicable) convert the Nix installation to a multi-user install
- Reconfigure the
nix-daemoninvocation
$ flox --version
1.12.0
Brew installIn your terminal run:
Verify Flox installationIf the following command returns without error then you’re ready to get
started!The version you see might be different.Upgrade existing Flox installation
brew install flox
NoteYou may be prompted for a
sudo password or be asked if your terminal has authorization to modify disk contents.This will replace an existing Nix installation
This will replace an existing Nix installation
Flox will reconfigure an existing Nix installation. These changes are designed to improve the overall user experience and make the Nix installation more reliable and easier to support, but it’s worth noting that anyone wishing to revert to a “vanilla” Nix installation after installing Flox will need to re-install Nix.If you want retain full control of your Nix installation, see the Nix (Generic) instructions.
When installing over a previous installation of Nix the Flox installation will:
When installing over a previous installation of Nix the Flox installation will:
- Back out customizations made to the following files when Nix was
installed:
/etc/bashrc/etc/bash.bashrc/etc/profile.d/nix.sh/etc/zshrc/etc/zsh/zshrc
- Overwrite the system-wide
/etc/nix/nix.conf - (If applicable) convert the Nix installation to a multi-user install
- Reconfigure the
nix-daemoninvocation
$ flox --version
1.12.0
brew upgrade flox
For use on Debian, Ubuntu, and other Debian-based distributions.Download and install the package
Verify Flox installationIf the following command returns without error then you’re ready to get
started!The version you see might be different.Upgrade existing Flox installation
NoteThe package will register a new source in
/etc/apt/sources.list.d to enable upgrades via apt.- Download flox.deb for your system architecture: 64-bit Intel/AMD 64-bit ARM
-
Install the downloaded file
sudo apt install /path/to/flox.deb
This will replace an existing Nix installation
This will replace an existing Nix installation
Flox will reconfigure an existing Nix installation. These changes are designed to improve the overall user experience and make the Nix installation more reliable and easier to support, but it’s worth noting that anyone wishing to revert to a “vanilla” Nix installation after installing Flox will need to re-install Nix.If you want retain full control of your Nix installation, see the Nix (Generic) instructions.
When installing over a previous installation of Nix the Flox installation will:
When installing over a previous installation of Nix the Flox installation will:
- Back out customizations made to the following files when Nix was
installed:
/etc/bashrc/etc/bash.bashrc/etc/profile.d/nix.sh/etc/zshrc/etc/zsh/zshrc
- Overwrite the system-wide
/etc/nix/nix.conf - (If applicable) convert the Nix installation to a multi-user install
- Reconfigure the
nix-daemoninvocation
$ flox --version
1.12.0
sudo apt update;
sudo apt --only-upgrade install flox
For use on RedHat, CentOS, Amazon Linux, and other RPM-based distributions.Download and install the package
Verify Flox installationIf the following command returns without error then you’re ready to get
started!The version you see might be different.Upgrade existing Flox installationor
NoteThe rpm will register a package repository in
/etc/yum.repos.d to enable upgrades.
via yum, dnf and other compatible tools.- Download flox.rpm for your system architecture: 64-bit Intel/AMD 64-bit ARM
-
Install the downloaded file
sudo rpm --import https://downloads.flox.dev/by-env/stable/rpm/flox-archive-keyring.asc sudo rpm -ivh /path/to/flox.rpm
This will replace an existing Nix installation
This will replace an existing Nix installation
Flox will reconfigure an existing Nix installation. These changes are designed to improve the overall user experience and make the Nix installation more reliable and easier to support, but it’s worth noting that anyone wishing to revert to a “vanilla” Nix installation after installing Flox will need to re-install Nix.If you want retain full control of your Nix installation, see the Nix (Generic) instructions.
When installing over a previous installation of Nix the Flox installation will:
When installing over a previous installation of Nix the Flox installation will:
- Back out customizations made to the following files when Nix was
installed:
/etc/bashrc/etc/bash.bashrc/etc/profile.d/nix.sh/etc/zshrc/etc/zsh/zshrc
- Overwrite the system-wide
/etc/nix/nix.conf - (If applicable) convert the Nix installation to a multi-user install
- Reconfigure the
nix-daemoninvocation
$ flox --version
1.12.0
sudo yum update flox
sudo dnf update flox
Which install method for existing Nix installation?Use the Flox installer for your system to allow some opinionated configuration of Nix, or use these “Nix (Generic)” instructions for full control of your Nix installation.
2.18.0 or greater.Install Flox with Nix imperatively-
Configure Substituters
Add the following values to
/etc/nix/nix.conf, taking care to merge them with anytrusted-substitutersortrusted-public-keysvalues that may already be defined:Then restart the/etc/nix/nix.confextra-trusted-substituters = https://cache.flox.dev extra-trusted-public-keys = flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=nix-daemon, if applicable:- Linux:
sudo systemctl stop nix-daemon.service sudo systemctl restart nix-daemon.socket - MacOS:
sudo launchctl kickstart -k -p system/org.nixos.nix-daemon
- Linux:
-
Install Flox to your personal profile:
nix profile install \ --experimental-features "nix-command flakes" \ --accept-flake-config \ 'github:flox/flox/latest' -
Install Flox to the system-wide
defaultprofile as root:sudo -H nix profile install \ --profile /nix/var/nix/profiles/default \ --experimental-features "nix-command flakes" \ --accept-flake-config \ 'github:flox/flox/latest'
On error
On error
If you encounter the following error then please upgrade your Nix
installation (and in particular the running If you encounter any other errors with the installer please report the
bug by way of discourse, including
a full copy of the command invoked and error encountered.
nix-daemon) to the latest
version (minimum supported version is 2.18.0):error: builder for '/nix/store/35l1qqyis11y88ic0cp3yxgv3286l4pb-flox-0.0.2-r295.drv' failed with exit code 1;
last 1 log lines:
> error: attribute 'requisites' missing
Using Flox's binary cache
Using Flox's binary cache
Flox hosts a binary cache for its packages, that can be added to your Or, to your flake configuration by using the Note that if you don’t add either of these options, Flox will be built from source, together with a patched version of Nix.
Which might take a while on less powerful systems.
/etc/nix/nix.conf file.
We recommend doing this if you are installing Flox system-wide./etc/nix/nix.conf
extra-trusted-substituters = https://cache.flox.dev
extra-trusted-public-keys = flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=
nixConfig attribute.
This will ensure that Flox’s binary cache is used for all operation within that flake.flake.nix
{
nixConfig = {
extra-trusted-substituters = ["https://cache.flox.dev"];
extra-trusted-public-keys = ["flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="];
};
}
{
description = "Example Darwin system flake";
nixConfig = {
extra-trusted-substituters = ["https://cache.flox.dev"];
extra-trusted-public-keys = ["flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="];
};
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-23.11-darwin";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
flox = {
url = "github:flox/flox/latest";
};
};
outputs = inputs@{ self, nix-darwin, nixpkgs, flox }:
let
configuration = { pkgs, ... }: {
environment.systemPackages =
[ pkgs.__YOUR_PACKAGES__
inputs.flox.packages.${pkgs.system}.default
];
nix.settings = {
experimental-features = "nix-command flakes";
substituters = [
"https://cache.flox.dev"
];
trusted-public-keys = [
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
];
};
__YOUR_CONFIG__
};
in
{
darwinConfigurations."__YOUR_HOST__" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
specialArgs = { inherit inputs; };
};
};
}
nix-darwin to install the configuration and packages you’ve declared.
This is an example on nix-darwin: nix run nix-darwin -- switch --flake ~/path/to/flakeVerify Flox installationIf the following command returns without error then you’re ready to get
started!$ flox --version
1.12.0
default profilesudo -H nix profile upgrade \
--profile /nix/var/nix/profiles/default \
--experimental-features "nix-command flakes" \
--accept-flake-config \
'.*flox'
nix profile upgrade \
--experimental-features "nix-command flakes" \
--accept-flake-config \
'.*flox'
nix flake update.Configure SubstitutersSimilarly configure … and then invoke:Install Flox
Verify Flox installationIf the following command returns without error then you’re ready to get
started!The version you see might be different.
/etc/nixos/configuration.nix to add the lines:/etc/nixos/configuration.nix
nix.settings.trusted-substituters = [ "https://cache.flox.dev" ];
nix.settings.trusted-public-keys = [ "flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=" ];
sudo nixos-rebuild switch
-
Install to your personal profile:
nix profile install \ --experimental-features "nix-command flakes" \ --accept-flake-config \ 'github:flox/flox/latest' -
Install Flox to the system-wide
defaultprofile as root:sudo -H nix profile install \ --profile /nix/var/nix/profiles/default \ --experimental-features "nix-command flakes" \ --accept-flake-config \ 'github:flox/flox/latest'
On error
On error
If you encounter the following error then please upgrade your Nix
installation (and in particular the running If you encounter any other errors with the installer please report the
bug by way of discourse, including
a full copy of the command invoked and error encountered.
nix-daemon) to the latest
version (minimum supported version is 2.18.0):error: builder for '/nix/store/35l1qqyis11y88ic0cp3yxgv3286l4pb-flox-0.0.2-r295.drv' failed with exit code 1;
last 1 log lines:
> error: attribute 'requisites' missing
$ flox --version
1.12.0
If you have Docker installed then you can also run flox in a container to
try it out before installing on your system.Invoke Flox containerVerify Flox installationIf the following command returns without error then you’re ready to get
started!The version you see might be different.
docker run --pull always --rm -it ghcr.io/flox/flox
$ flox --version
1.12.0
Support for WSL 2 is experimental.
Install WSL 2Please install and configure WSL version 2 as described in the
Microsoft Learn Install
WSL
guide before installing Flox. Please also ensure the
state
(whether the distribution is running or stopped) is running.Note that installation will fail on WSL 1.
- list installed distributions:
wsl --list - run specified distribution:
wsl --distribution <name> - list all available distributions:
wsl --list --online - install distribution:
wsl --install -d <name> - terminate distribution:
wsl --terminate <name> - unregister and delete distribution:
wsl --unregister <name>
Ubuntu
Ubuntu
Download and install the package
- Download flox.deb for your system architecture: 64-bit Intel/AMD 64-bit ARM
-
Install the downloaded file
sudo dpkg -i /path/to/flox.deb
Debian
Debian
Install prerequisitesDownload and install the package
sudo apt-get install policycoreutils semodule-utils tar wget xz-utils
- Download flox.deb for your system architecture: 64-bit Intel/AMD 64-bit ARM
-
Install the downloaded file
sudo dpkg -i /path/to/flox.deb
OracleLinux_8_5
OracleLinux_8_5
Install prerequisitesDownload and install the package
sudo yum install tar xz
- Download flox.rpm for your system architecture: 64-bit Intel/AMD 64-bit ARM
-
Install the downloaded file
sudo rpm -ivh /path/to/flox.rpm
Ignore warning about systemdYou will encounter the following warning during the installation:You can disregard this message as we will be configuring the
---- warning! ------------------------------------------------------------------
We did not detect systemd on your system. With a multi-user install
without systemd you will have to manually configure your init system to
launch the Nix daemon after installation.
nix-daemon to start automatically in the next section.nix-daemon to start on activationOnce Flox has been installed on your WSL distribution the nix-daemon will
need to be automatically started as you start your WSL instance.Run the following command to add the necessary logic to invoke nix-daemon
by way of your ~/.bashrc file:cat >> ~/.bashrc <<EOF
( wsl.exe -d $WSL_DISTRO_NAME -u root service nix-daemon status 2>&1 >/dev/null ) || wsl.exe -d $WSL_DISTRO_NAME -u root service nix-daemon start
EOF
nix-daemon is working correctly:nix --extra-experimental-features nix-command store ping
$ flox --version
1.12.0