Man page - nix-profiles(5)
Packages contains this manual
- nix3-store-prefetch-file(1)
- nix3-flake(1)
- nix-instantiate(1)
- nix-profiles(5)
- nix3-store-sign(1)
- nix3-hash-to-sri(1)
- nix3-nar-ls(1)
- nix-store-verify(1)
- nix3-profile-wipe-history(1)
- nix3-derivation-add(1)
- nix-env-upgrade(1)
- nix3-store-add(1)
- nix(1)
- nix3-store-verify(1)
- nix-env-list-generations(1)
- nix3-store-repair(1)
- nix-store-query(1)
- nix3-flake-archive(1)
- nix-store-load-db(1)
- nix3-store-dump-path(1)
- nix3-realisation(1)
- nix3-derivation-show(1)
- nix3-store-path-from-hash-part(1)
- nix3-flake-prefetch(1)
- nix3-develop(1)
- nix3-help(1)
- nix3-store-make-content-addressed(1)
- nix3-hash-to-base64(1)
- nix3-log(1)
- nix3-nar(1)
- nix-store-import(1)
- nix3-registry-pin(1)
- nix3-config(1)
- nix3-copy(1)
- nix3-nar-pack(1)
- nix3-nar-cat(1)
- nix3-store-cat(1)
- nix-store-realise(1)
- nix3-key(1)
- nix3-run(1)
- nix3-store-copy-sigs(1)
- nix3-flake-check(1)
- nix3-hash-path(1)
- nix-channel(1)
- nix-store-gc(1)
- nix-build(1)
- nix-store-dump-db(1)
- nix3-flake-clone(1)
- nix3-registry-remove(1)
- nix-store-add-fixed(1)
- nix3-print-dev-env(1)
- nix3-help-stores(1)
- nix3-key-convert-secret-to-public(1)
- nix-env(1)
- nix3-profile(1)
- nix3-profile-list(1)
- nix3-store-ls(1)
- nix3-profile-install(1)
- nix3-flake-lock(1)
- nix-store-dump(1)
- nix-store-delete(1)
- nix3-hash(1)
- nix-env-install(1)
- nix-store-repair-path(1)
- nix3-daemon(1)
- nix3-config-show(1)
- nix3-flake-init(1)
- nix3-profile-diff-closures(1)
- nix3-hash-to-base16(1)
- nix-store-read-log(1)
- nix.conf(5)
- nix3-store-copy-log(1)
- nix3-eval(1)
- nix3-store-info(1)
- nix3-repl(1)
- nix-hash(1)
- nix3-store-add-path(1)
- nix-collect-garbage(1)
- nix3-key-generate-secret(1)
- nix-store-optimise(1)
- nix-store-print-env(1)
- nix3-store-diff-closures(1)
- nix3-flake-new(1)
- nix3-flake-metadata(1)
- nix3-config-check(1)
- nix-store-serve(1)
- nix3-store-gc(1)
- nix-store-generate-binary-cache-key(1)
- nix-store(1)
- nix3-upgrade-nix(1)
- nix-env-switch-generation(1)
- nix3-why-depends(1)
- nix3-path-info(1)
- nix3-store-add-file(1)
- nix3-profile-remove(1)
- nix3-registry-list(1)
- nix3-fmt(1)
- nix3-derivation(1)
- nix3-env-shell(1)
- nix-env-query(1)
- nix-env-switch-profile(1)
- nix3-flake-show(1)
- nix-copy-closure(1)
- nix-env-delete-generations(1)
- nix3-store(1)
- nix3-realisation-info(1)
- nix-daemon(8)
- nix3-hash-convert(1)
- nix-env-set-flag(1)
- nix3-registry(1)
- nix3-bundle(1)
- nix3-profile-upgrade(1)
- nix3-profile-rollback(1)
- nix-prefetch-url(1)
- nix3-edit(1)
- nix3-store-ping(1)
- nix3-store-optimise(1)
- nix-store-add(1)
- nix-store-restore(1)
- nix3-flake-info(1)
- nix-store-export(1)
- nix-store-verify-path(1)
- nix3-store-delete(1)
- nix3-registry-add(1)
- nix3-build(1)
- nix3-nar-dump-path(1)
- nix3-search(1)
- nix-shell(1)
- nix3-hash-file(1)
- nix3-profile-history(1)
- nix-env-uninstall(1)
- nix3-flake-update(1)
- nix-env-set(1)
- nix-env-rollback(1)
- nix3-hash-to-base32(1)
apt-get install nix-bin
Manual
nix-profiles
ProfilesFilesystem layout
User profile link
Profiles
A directory that contains links to profiles managed by nix-env and nix profile :
|
β’ |
$XDG_STATE_HOME/nix/profiles for regular users |
|||
|
β’ |
$NIX_STATE_DIR/profiles/per-user/root if the user is root |
A profile is a directory of symlinks to files in the Nix store.
Filesystem layout
Profiles are versioned as follows. When using a profile named path , path is a symlink to path - N -link, where N is the version of the profile. In turn, path - N -link is a symlink to a path in the Nix store. For example:
$ ls -l
~alice/.local/state/nix/profiles/profile*
lrwxrwxrwx 1 alice users 14 Nov 25 14:35
/home/alice/.local/state/nix/profiles/profile ->
profile-7-link
lrwxrwxrwx 1 alice users 51 Oct 28 16:18
/home/alice/.local/state/nix/profiles/profile-5-link ->
/nix/store/q69xad13ghpf7ir87h0b2gd28lafjj1j-profile
lrwxrwxrwx 1 alice users 51 Oct 29 13:20
/home/alice/.local/state/nix/profiles/profile-6-link ->
/nix/store/6bvhpysd7vwz7k3b0pndn7ifi5xr32dg-profile
lrwxrwxrwx 1 alice users 51 Nov 25 14:35
/home/alice/.local/state/nix/profiles/profile-7-link ->
/nix/store/mp0x6xnsg0b8qhswy6riqvimai4gm677-profile
Each of these symlinks is a root for the Nix garbage collector.
The contents of the store path corresponding to each version of the profile is a tree of symlinks to the files of the installed packages, e.g.
$ ll -R
~eelco/.local/state/nix/profiles/profile-7-link/
/home/eelco/.local/state/nix/profiles/profile-7-link/:
total 20
dr-xr-xr-x 2 root root 4096 Jan 1 1970 bin
-r--r--r-- 2 root root 1402 Jan 1 1970 manifest.nix
dr-xr-xr-x 4 root root 4096 Jan 1 1970 share
/home/eelco/.local/state/nix/profiles/profile-7-link/bin:
total 20
lrwxrwxrwx 5 root root 79 Jan 1 1970 chromium ->
/nix/store/ijm5k0zqisvkdwjkc77mb9qzb35xfi4m-chromium-86.0.4240.111/bin/chromium
lrwxrwxrwx 7 root root 87 Jan 1 1970 spotify ->
/nix/store/w9182874m1bl56smps3m5zjj36jhp3rn-spotify-1.1.26.501.gbe11e53b-15/bin/spotify
lrwxrwxrwx 3 root root 79 Jan 1 1970 zoom-us ->
/nix/store/wbhg2ga8f3h87s9h5k0slxk0m81m4cxl-zoom-us-5.3.469451.0927/bin/zoom-us
/home/eelco/.local/state/nix/profiles/profile-7-link/share/applications:
total 12
lrwxrwxrwx 4 root root 120 Jan 1 1970
chromium-browser.desktop ->
/nix/store/4cf803y4vzfm3gyk3vzhzb2327v0kl8a-chromium-unwrapped-86.0.4240.111/share/applications/chromium-browser.desktop
lrwxrwxrwx 7 root root 110 Jan 1 1970 spotify.desktop ->
/nix/store/w9182874m1bl56smps3m5zjj36jhp3rn-spotify-1.1.26.501.gbe11e53b-15/share/applications/spotify.desktop
lrwxrwxrwx 3 root root 107 Jan 1 1970 us.zoom.Zoom.desktop
->
/nix/store/wbhg2ga8f3h87s9h5k0slxk0m81m4cxl-zoom-us-5.3.469451.0927/share/applications/us.zoom.Zoom.desktop
β¦
Each profile version contains a manifest file: - manifest.nix used by nix-env . - manifest.json used by nix profile (experimental).
User profile link
A symbolic link to the userβs current profile:
|
β’ |
~/.nix-profile |
||
|
β’ |
$XDG_STATE_HOME/nix/profile if use-xdg-base-directories is set to true. |
By default, this symlink points to:
|
β’ |
$XDG_STATE_HOME/nix/profiles/profile for regular users |
|||
|
β’ |
$NIX_STATE_DIR/profiles/per-user/root/profile for root |
The PATH environment variable should include /bin subdirectory of the profile link (e.g. ~/.nix-profile/bin) for the user environment to be visible to the user. The installer sets this up by default, unless you enable use-xdg-base-directories .