mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
nix-env -i: Add a flag ‘--remove-all’ / ‘-r’
This is equivalent to running ‘nix-env -e '*'’ first, except that it happens in a single transaction. Thus, ‘nix-env -i pkgs...’ replaces the profile with the specified set of packages. The main motivation is to support declarative package management (similar to environment.systemPackages in NixOS). That is, if you have a specification ‘profile.nix’ like this: with import <nixpkgs> {}; [ thunderbird geeqie ... ] then after any change to ‘profile.nix’, you can run: $ nix-env -f profile.nix -ir to update the profile to match the specification. (Without the ‘-r’ flag, if you remove a package from ‘profile.nix’, it won't be removed from the actual profile.) Suggested by @zefhemel.
This commit is contained in:
parent
88c07341a6
commit
2c1ecf8e81
2 changed files with 39 additions and 17 deletions
|
@ -209,6 +209,10 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
<arg choice='plain'><option>--preserve-installed</option></arg>
|
||||
<arg choice='plain'><option>-P</option></arg>
|
||||
</group>
|
||||
<group choice='opt'>
|
||||
<arg choice='plain'><option>--remove-all</option></arg>
|
||||
<arg choice='plain'><option>-r</option></arg>
|
||||
</group>
|
||||
<arg choice='plain' rep='repeat'><replaceable>args</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
|
@ -318,6 +322,16 @@ number of possible ways:
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--remove-all</option></term>
|
||||
<term><option>-r</option></term>
|
||||
|
||||
<listitem><para>Remove all previously installed packages first.
|
||||
This is equivalent to running <literal>nix-env -e '*'</literal>
|
||||
first, except that everything happens in a single
|
||||
transaction.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</refsection>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue