aboutsummaryrefslogtreecommitdiff
path: root/src/nix/profile-upgrade.md
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-01-22 16:22:00 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-01-22 16:22:00 +0000
commit5738b08233022b8cb74b1550ac0fe9d620ff52cd (patch)
tree886f1ee22f92a240f235df1eecfdad8e505f4d15 /src/nix/profile-upgrade.md
parentbd96403da6a1181e46a52be7befade0c00f9e743 (diff)
parentb7bfc7ee52dd425e0156f369eb4c05a62358f912 (diff)
Merge remote-tracking branch 'upstream/master' into trustless-remote-builder-simple
Diffstat (limited to 'src/nix/profile-upgrade.md')
-rw-r--r--src/nix/profile-upgrade.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/nix/profile-upgrade.md b/src/nix/profile-upgrade.md
new file mode 100644
index 000000000..2bd5d256d
--- /dev/null
+++ b/src/nix/profile-upgrade.md
@@ -0,0 +1,41 @@
+R""(
+
+# Examples
+
+* Upgrade all packages that were installed using a mutable flake
+ reference:
+
+ ```console
+ # nix profile upgrade '.*'
+ ```
+
+* Upgrade a specific package:
+
+ ```console
+ # nix profile upgrade packages.x86_64-linux.hello
+ ```
+
+* Upgrade a specific profile element by number:
+
+ ```console
+ # nix profile info
+ 0 flake:nixpkgs#legacyPackages.x86_64-linux.spotify …
+
+ # nix profile upgrade 0
+ ```
+
+# Description
+
+This command upgrades a previously installed package in a Nix profile,
+by fetching and evaluating the latest version of the flake from which
+the package was installed.
+
+> **Warning**
+>
+> This only works if you used a *mutable* flake reference at
+> installation time, e.g. `nixpkgs#hello`. It does not work if you
+> used an *immutable* flake reference
+> (e.g. `github:NixOS/nixpkgs/13d0c311e3ae923a00f734b43fd1d35b47d8943a#hello`),
+> since in that case the "latest version" is always the same.
+
+)""