FAQ: Difference between revisions

Ardenet (talk | contribs)
m Adjust the position of page translation tags
m I changed the user script to one with a minor fix to correctly redirect search pages.
 
(One intermediate revision by one other user not shown)
Line 28: Line 28:
Also see:
Also see:
* https://wiki.nixos.org/wiki/User:Winny/WikiRisks
* https://wiki.nixos.org/wiki/User:Winny/WikiRisks
* https://greasyfork.org/en/scripts/495011-redirect-to-wiki-nixos-org (trivial userscript to redirect nixos.wiki links here)
* https://greasyfork.org/en/scripts/560152-redirect-to-wiki-nixos-org (trivial userscript to redirect nixos.wiki links here)


=== Why is Nix written in C++ rather than a functional language like Haskell? === <!--T:2-->
=== Why is Nix written in C++ rather than a functional language like Haskell? === <!--T:2-->
Line 415: Line 415:


<translate>
<translate>
=== There's an updated version for $software on the unstable branch, but I use stable, how can I use it? ===
=== There's an updated version for $software on the unstable branch, but I use stable, how can I use it? === <!--T:143-->


<!--T:144-->
Before going ahead with this, note that firstly, this likely means that the package you intend to update has had a major version change. If you have used it previously, there is a chance that your existing data either will not work with the new version or will need to be migrated; If in doubt, consult the upstream documentation of the package.  
Before going ahead with this, note that firstly, this likely means that the package you intend to update has had a major version change. If you have used it previously, there is a chance that your existing data either will not work with the new version or will need to be migrated; If in doubt, consult the upstream documentation of the package.  


<!--T:145-->
Secondly, while you're less likely to run into issues on NixOS than on, for example, Debian when installing packages from different releases, it's not impossible.
Secondly, while you're less likely to run into issues on NixOS than on, for example, Debian when installing packages from different releases, it's not impossible.


<!--T:146-->
Nix ensures that libraries and (usually) runtime dependencies of packages are kept separate, so that you can trivially have many versions of those dependencies installed, without affecting the versions of said dependencies used by important system components. This ensures that you cannot accidentally break your package manager by, say, updating Python, as is quite common on other distros.
Nix ensures that libraries and (usually) runtime dependencies of packages are kept separate, so that you can trivially have many versions of those dependencies installed, without affecting the versions of said dependencies used by important system components. This ensures that you cannot accidentally break your package manager by, say, updating Python, as is quite common on other distros.


<!--T:147-->
Nix cannot however ensure that there will be no incompatibilities with services of which there can inherently be only one running instance. As an example, if you try to use a package from unstable on a stable system that requires a feature in systemd that is not yet present in the systemd version on stable, this package will not work; it's simply not possible to run two different versions of systemd simultaneously.
Nix cannot however ensure that there will be no incompatibilities with services of which there can inherently be only one running instance. As an example, if you try to use a package from unstable on a stable system that requires a feature in systemd that is not yet present in the systemd version on stable, this package will not work; it's simply not possible to run two different versions of systemd simultaneously.


<!--T:148-->
Nonetheless, it's quite uncommon that end-user facing applications rely on such singleton services, or at the very least they will typically have internal backwards compatibility. As such, mixing channels is usually unproblematic in practice, and even if not, NixOS' rollback features make it trivial to recover from problems should they occur.
Nonetheless, it's quite uncommon that end-user facing applications rely on such singleton services, or at the very least they will typically have internal backwards compatibility. As such, mixing channels is usually unproblematic in practice, and even if not, NixOS' rollback features make it trivial to recover from problems should they occur.


==== Using channels ====
==== Using channels ==== <!--T:149-->


<!--T:150-->
First we need to add the unstable channel to our system channels:
First we need to add the unstable channel to our system channels:


<!--T:151-->
{{Warning|`nixos-rebuild --upgrade` will by default only update the channel named `nixos`, which this new channel is not. Use `nixos-rebuild --upgrade-all` instead.}}
{{Warning|`nixos-rebuild --upgrade` will by default only update the channel named `nixos`, which this new channel is not. Use `nixos-rebuild --upgrade-all` instead.}}
</translate>
</translate>
Line 440: Line 447:


<translate>
<translate>
<!--T:152-->
Then we can import this channel using the angle-bracket notation to refer to it:
Then we can import this channel using the angle-bracket notation to refer to it:
</translate>
</translate>
Line 462: Line 470:


<translate>
<translate>
==== Using flakes ====
==== Using flakes ==== <!--T:153-->


<!--T:154-->
We simply add the unstable branch to our flake inputs, and pass them into the NixOS module system using <code>specialArgs</code>:
We simply add the unstable branch to our flake inputs, and pass them into the NixOS module system using <code>specialArgs</code>:
</translate>
</translate>
Line 498: Line 507:


<translate>
<translate>
<!--T:155-->
Using this in <code>configuration.nix</code> then looks as follows:
Using this in <code>configuration.nix</code> then looks as follows:
</translate>
</translate>
Line 761: Line 771:


<translate>
<translate>
== References == <!--T:134-->
== References == <!--T:134-->