Home Explore Blog CI



nix

src/nix/profile.md
07444efc507921275f7e04ecedcb3a08065cb76d02b1909600000003000004af
R""(

# Description

`nix profile` allows you to create and manage *Nix profiles*. A Nix
profile is a set of packages that can be installed and upgraded
independently from each other. Nix profiles are versioned, allowing
them to be rolled back easily.

# Files

)""

#include "profiles.md.gen.hh"

R""(

### Profile compatibility

> **Warning**
>
> Once you have used [`nix profile`] you can no longer use [`nix-env`] without first deleting `$XDG_STATE_HOME/nix/profiles/profile`


Once you installed a package with [`nix profile`], you get the following error message when using [`nix-env`]:

```console
$ nix-env -f '<nixpkgs>' -iA 'hello'
error: nix-env
profile '/home/alice/.local/state/nix/profiles/profile' is incompatible with 'nix-env'; please use 'nix profile' instead
```

To migrate back to `nix-env` you can delete your current profile:

> **Warning**
>
> This will delete packages that have been installed before, so you may want to back up this information before running the command.

```console
 $ rm -rf "${XDG_STATE_HOME-$HOME/.local/state}/nix/profiles/profile"
```

)""

Chunks
e2a67b4b (1st chunk of `src/nix/profile.md`)
Title: Nix Profiles: Description and Compatibility
Summary
Nix profiles are sets of packages that can be installed and upgraded independently, with versioning for easy rollback. However, once a package is installed with `nix profile`, `nix-env` can no longer be used without deleting the profile. Instructions are provided to migrate back to `nix-env`, warning about the potential loss of previously installed packages.