Ubuntu vs. NixOS: Difference between revisions
imported>Fricklerhandwerk remove redundant blurb |
Remove duplicate header |
||
(6 intermediate revisions by 4 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. | ||
Line 189: | Line 185: | ||
|Find packages | |Find packages | ||
|<syntaxhighlight lang="console">$ apt-cache search emacs</syntaxhighlight> | |<syntaxhighlight lang="console">$ apt-cache search emacs</syntaxhighlight> | ||
|<syntaxhighlight lang="console">$ nix-env -qaP '.*emacs.*'</syntaxhighlight> or <syntaxhighlight lang="console">$ nix search emacs</syntaxhighlight> | |<syntaxhighlight lang="console">$ nix-env -qaP '.*emacs.*'</syntaxhighlight> or <syntaxhighlight lang="console">$ nix search nixpkgs emacs</syntaxhighlight> | ||
|<syntaxhighlight lang="console">$ nix-env -qaP '.*emacs.*'</syntaxhighlight> or <syntaxhighlight lang="console">$ nix search emacs</syntaxhighlight> | |<syntaxhighlight lang="console">$ nix-env -qaP '.*emacs.*'</syntaxhighlight> or <syntaxhighlight lang="console">$ nix search nixpkgs emacs</syntaxhighlight> | ||
|- | |- | ||
|Show package description | |Show package description | ||
Line 294: | Line 290: | ||
</div> | </div> | ||
[[Category:Cookbook]] |