Home Explore Blog Models CI



nix

doc/manual/source/command-ref/nix-env/set.md
762ef9243a9160e0bc2215980cdce930cbdd13310df73fb60000000300000243
# Name

`nix-env --set` - set profile to contain a specified derivation

## Synopsis

`nix-env` `--set` *drvname*

## Description

The `--set` operation modifies the current generation of a profile so
that it contains exactly the specified derivation, and nothing else.

{{#include ./opt-common.md}}

{{#include ../opt-common.md}}

{{#include ./env-common.md}}

{{#include ../env-common.md}}

## Examples

The following updates a profile such that its current generation will
contain just Firefox:

```console
$ nix-env --profile /nix/var/nix/profiles/browser --set firefox
```


Chunks
4677383b (1st chunk of `doc/manual/source/command-ref/nix-env/set.md`)
Title: nix-env --set: Set Profile to a Specific Derivation
Summary
The `nix-env --set` command is used to modify the current generation of a Nix profile, making it contain only a specified derivation. Its syntax is `nix-env --set drvname`. For example, `nix-env --profile /nix/var/nix/profiles/browser --set firefox` would update the browser profile to exclusively contain Firefox.