Ubuntu vs. NixOS: Difference between revisions
imported>Ncfavier update nix search command |
Remove duplicate header |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<!-- TODO''': Provide well-commented sample configuration.nix and ~/.nixpkgs/config.nix files with examples of common tasks. --> | |||
<div class="table-responsive"> | <div class="table-responsive"> | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 36: | Line 32: | ||
|Where are packages installed? | |Where are packages installed? | ||
|apt installs globally into /bin/, /usr/, etc. | |apt installs globally into /bin/, /usr/, etc. | ||
|System-wide packages are in /run/current-system/sw/ (these are installed because of /etc/nixos/configuration.nix) and /nix/var/nix/profiles/default/bin/ (this is the profile managed by root). Note that the files are just symlinks to the real packages managed by nix /nix/store/. | |System-wide packages are in /run/current-system/sw/ (these are installed because of /etc/nixos/configuration.nix) and /nix/var/nix/profiles/default/bin/ (this is the profile managed by root). Note that the files are just symlinks to the real packages managed by nix in /nix/store/. | ||
|User packages are in ~/.nix-profile/. Note that the files are just symlinks to the real packages managed by nix in /nix/store/. | |User packages are in ~/.nix-profile/. Note that the files are just symlinks to the real packages managed by nix in /nix/store/. | ||
|- | |- | ||
Line 164: | Line 160: | ||
|Install a particular version of a package | |Install a particular version of a package | ||
|<syntaxhighlight lang="console">$ apt-get install package=version</syntaxhighlight> | |<syntaxhighlight lang="console">$ apt-get install package=version</syntaxhighlight> | ||
|Although Nix on its own doesn't understand the concept of package versioning, you can install and play with older (or newer!) software via | |Although Nix on its own doesn't understand the concept of package versioning, you can install and play with older (or newer!) software via [[FAQ/Pinning Nixpkgs]] with https://lazamar.co.uk/nix-versions. | ||