Skip to content

Commit

Permalink
Merge pull request #9656 from edolstra/nix-profile-stable-names
Browse files Browse the repository at this point in the history
Make profile element names stable
  • Loading branch information
edolstra authored Jan 12, 2024
2 parents 0d55d66 + 72560f7 commit 52f949b
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 123 deletions.
4 changes: 3 additions & 1 deletion doc/manual/rl-next/nix-profile-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ synopsis: "`nix profile` now allows referring to elements by human-readable name
prs: 8678
---

[`nix profile`](@docroot@/command-ref/new-cli/nix3-profile.md) now uses names to refer to installed packages when running [`list`](@docroot@/command-ref/new-cli/nix3-profile-list.md), [`remove`](@docroot@/command-ref/new-cli/nix3-profile-remove.md) or [`upgrade`](@docroot@/command-ref/new-cli/nix3-profile-upgrade.md) as opposed to indices. Indices are deprecated and will be removed in a future version.
[`nix profile`](@docroot@/command-ref/new-cli/nix3-profile.md) now uses names to refer to installed packages when running [`list`](@docroot@/command-ref/new-cli/nix3-profile-list.md), [`remove`](@docroot@/command-ref/new-cli/nix3-profile-remove.md) or [`upgrade`](@docroot@/command-ref/new-cli/nix3-profile-upgrade.md) as opposed to indices. Profile element names are generated when a package is installed and remain the same until the package is removed.

**Warning**: The `manifest.nix` file used to record the contents of profiles has changed. Nix will automatically upgrade profiles to the new version when you modify the profile. After that, the profile can no longer be used by older versions of Nix.
2 changes: 0 additions & 2 deletions src/nix/profile-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ R""(
```console
# nix profile list
Name: gdb
Index: 0
Flake attribute: legacyPackages.x86_64-linux.gdb
Original flake URL: flake:nixpkgs
Locked flake URL: github:NixOS/nixpkgs/7b38b03d76ab71bdc8dc325e3f6338d984cc35ca
Store paths: /nix/store/indzcw5wvlhx6vwk7k4iq29q15chvr3d-gdb-11.1

Name: blender-bin
Index: 1
Flake attribute: packages.x86_64-linux.default
Original flake URL: flake:blender-bin
Locked flake URL: github:edolstra/nix-warez/91f2ffee657bf834e4475865ae336e2379282d34?dir=blender
Expand Down
7 changes: 0 additions & 7 deletions src/nix/profile-remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ R""(
# nix profile remove hello
```

* Remove a package by index
*(deprecated, will be removed in a future version)*:

```console
# nix profile remove 3
```

* Remove all packages:

```console
Expand Down
7 changes: 0 additions & 7 deletions src/nix/profile-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ R""(
# nix profile upgrade hello
```

* Upgrade a specific package by index
*(deprecated, will be removed in a future version)*:

```console
# nix profile upgrade 0
```

# Description

This command upgrades a previously installed package in a Nix profile,
Expand Down
Loading

0 comments on commit 52f949b

Please sign in to comment.