mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-05-13 19:21:12 +08:00
apostrophe
This commit is contained in:
parent
49bb8df152
commit
65983d8f1c
1 changed files with 10 additions and 10 deletions
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
== Why Nix?
|
||||
|
||||
If you’ve opened this PDF, you already have your own motivation for
|
||||
learning Nix. Here’s how it helps me. As a researcher, I tend to work on
|
||||
If you've opened this PDF, you already have your own motivation for
|
||||
learning Nix. Here's how it helps me. As a researcher, I tend to work on
|
||||
a series of short-term projects, mostly demos and prototypes. For each
|
||||
one, I typically develop some software using a compiler, often with some
|
||||
open source libraries. Often I use other tools to analyse data or
|
||||
|
|
@ -13,28 +13,28 @@ Problems would arise when handing off the project to colleagues; they
|
|||
would report errors when trying to build or run the project. Belatedly I
|
||||
would realise that my code relies on a library that they need to
|
||||
install. Or perhaps they had installed the library, but the version
|
||||
they’re using is incompatible.
|
||||
they're using is incompatible.
|
||||
|
||||
Using containers helped with the problem. However, I didn’t want to
|
||||
Using containers helped with the problem. However, I didn't want to
|
||||
_develop_ in a container. I did all my development in my nice, familiar,
|
||||
environment with my custom aliases and shell prompt. and _then_ I
|
||||
containerised the software. This added step was annoying for me, and if
|
||||
my colleague wanted to do some additional development, they would
|
||||
probably extract all of the source code from the container first anyway.
|
||||
Containers are great, but this isn’t the ideal use case for them.
|
||||
Containers are great, but this isn't the ideal use case for them.
|
||||
|
||||
Nix allows me to work in my custom environment, but forces me to specify
|
||||
any dependencies. It automatically tracks the version of each dependency
|
||||
so that it can replicate the environment wherever and whenever it’s
|
||||
so that it can replicate the environment wherever and whenever it's
|
||||
needed.
|
||||
|
||||
== Why _flakes_?
|
||||
|
||||
Flakes are labeled as an experimental feature, so it might seem safer to
|
||||
avoid them. However, they have been in use for years, and there is
|
||||
widespread adoption, so the aren’t going away any time soon. Flakes are
|
||||
widespread adoption, so the aren't going away any time soon. Flakes are
|
||||
easier to understand, and offer more features than the traditional Nix
|
||||
approach. After weighing the pros and cons, I feel it’s better to learn
|
||||
approach. After weighing the pros and cons, I feel it's better to learn
|
||||
and use flakes; and this seems to be the general consensus.
|
||||
|
||||
== Prerequisites
|
||||
|
|
@ -54,11 +54,11 @@ see the instructions in the https://nixos.wiki/wiki/Flakes[NixOS wiki].
|
|||
|
||||
[IMPORTANT]
|
||||
====
|
||||
There are hyphenated and unhyphenated versions of many Nix commands.
|
||||
There are hyphenated and un-hyphenated versions of many Nix commands.
|
||||
For example, `nix-shell` and `nix shell` are two different commands.
|
||||
Don't confuse them!
|
||||
|
||||
Generally speaking, the unhyphenated versions are for working directly
|
||||
Generally speaking, the un-hyphenated versions are for working directly
|
||||
with flakes, while the hyphenated versions are for everything else.
|
||||
====
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue