Basics¶
This is a rundown on how to use flox
and its most common commands.
If you haven't already, please install flox before continuing.
1. flox search
- search through available packages¶
$ flox search ripgrep
ripgrep - A utility that combines the usability of The Silver Searcher with the raw speed of grep
ripgrep-all - Ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, and more
vgrep - User-friendly pager for grep/git-grep/ripgrep
Need more versions of the packages?
$ flox search ripgrep --verbose
ripgrep - A utility that combines the usability of The Silver Searcher with the raw speed of grep
stable.nixpkgs-flox.ripgrep@13.0.0
staging.nixpkgs-flox.ripgrep@13.0.0
unstable.nixpkgs-flox.ripgrep@13.0.0
ripgrep-all - Ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, and more
stable.nixpkgs-flox.ripgrep-all@0.9.6
staging.nixpkgs-flox.ripgrep-all@0.9.6
unstable.nixpkgs-flox.ripgrep-all@0.9.6
vgrep - User-friendly pager for grep/git-grep/ripgrep
stable.nixpkgs-flox.vgrep@2.5.5
stable.nixpkgs-flox.vgrep@2.6.0
stable.nixpkgs-flox.vgrep@2.6.1
staging.nixpkgs-flox.vgrep@2.5.5
staging.nixpkgs-flox.vgrep@2.6.0
staging.nixpkgs-flox.vgrep@2.6.1
unstable.nixpkgs-flox.vgrep@2.5.5
unstable.nixpkgs-flox.vgrep@2.6.0
unstable.nixpkgs-flox.vgrep@2.6.1
-
stability allows for previewing and testing package upgrades.
When in doubt, always use the stable stability.
Default stabilities are: stable, staging and unstable.
-
channel is a place (eg. a GitHub repository) where records of package builds are collected. Most comonly each organization would have at least one channel.
nixpkgs-flox is a flox channel that collects records of built packages from the NixOS/nixpkgs GitHub repository.
Note: flox channels are not Nix channels.
-
name is the name of a package in that channel.
-
version points to a specific version of a package.
2. flox install
- install packages¶
-
By default packages get installed into the default environment.
To better understand environments, please read the environments tutorial.
You can also install multiple packages at the same time.
$ flox install cowsay@3.04 unstable.fortune # (1)!
Installed 'cowsay@3.04', 'unstable.fortune' package(s) into 'default' environment.
-
You can be as specific or as general as you want when installing packages.
In this example we asked for: - a specific version (
3.04
) ofcowsay
- and for afortune
package fromunstable
stability.
3. flox remove
- remove installed packages¶
4. flox list
- list installed packages¶
$ flox list
local/aarch64-darwin.default
Alias default
System aarch64-darwin
Path /Users/USER/.local/share/flox/environments/local/aarch64-darwin.default
Curr Gen 3
Packages
0 stable.nixpkgs-flox.cowsay 3.04
1 stable.nixpkgs-flox.fortune mod-3.14.1
5. flox activate
- activate flox environment¶
$ fortune | cowsay
bash: cowsay: command not found
bash: fortune: command not found
$ flox activate # (1)!
flox [default] $ fortune | cowsay
________________________
< Clones are people two. >
------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
flox [default] $ exit
$
-
This will activate the default environment.
flox
supports multiple environments; see the tutorial on Environments to learn more.
Where to next?¶
We just scratched the surface of what flox
can do.
-
A good first step is learning to work with multiple environments.
-
If you want to share your work, head to share environments.
-
More advanced users can follow the tutorial to build custom packages.