This commit is contained in:
Amy de Buitléir 2025-09-14 19:22:50 +01:00
parent fc5b0d86d7
commit 605cde03cd
3 changed files with 11 additions and 6 deletions

View file

@ -41,9 +41,9 @@ Once we exit that shell, the `hello-flake` command is no longer
directly available.
....
$# echo '$ exit'
$# echo '$ hello-flake'
sh: line 3: hello-flake: command not found
$# echo executable=$(which hello-flake) > temp.sh # save variable
$ exit
$ hello-flake # Won't work outside development shell
....
However, we can still run the command using the store path we found
@ -51,7 +51,8 @@ earlier. That's not particularly convenient, but it does demonstrate
that the package remains in the store for future use.
....
$# executable=$(which hello-flake)
$# source temp.sh # restore variable
$# rm temp.sh
$# echo '$ '${executable}
$# ${executable}
....

View file

@ -9,7 +9,10 @@ An attribute set that is used as a function parameter is often called an _argume
To specify an attribute set as a function parameter, we use a _set pattern_,
which has the form
{ _name1_, _name2_, ... }
[source,subs=quotes]
----
{ _name1_, _name2_, ... }
----
Note that while the key-value associations in attribute sets are separated by semi-colons,
the key names in the attribute set _pattern are separated by commas.

View file

@ -44,7 +44,8 @@ a path
....
If an expression can be interpreted as a path, Nix will do so.
This is useful, because paths are _far_ more commonly used in Nix expressions that arithmetic operators.
This is useful, because paths are _far_ more commonly used in Nix expressions
than arithmetic operators.
In this case, Nix interpreted `6/2` as a relative path from the current directory,
which in the above example was `/home/amy/codeberg/nix-book`.