summaryrefslogtreecommitdiffhomepage
path: root/nix.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'nix.html.markdown')
-rw-r--r--nix.html.markdown15
1 files changed, 12 insertions, 3 deletions
diff --git a/nix.html.markdown b/nix.html.markdown
index 5941f0e6..677aaf54 100644
--- a/nix.html.markdown
+++ b/nix.html.markdown
@@ -279,7 +279,7 @@ with builtins; [
#=> 7
# This first line of tutorial starts with "with builtins;"
- # because builtins is a set the contains all of the built-in
+ # because builtins is a set that contains all of the built-in
# functions (length, head, tail, filter, etc.). This saves
# us from having to write, for example, "builtins.length"
# instead of just "length".
@@ -305,6 +305,9 @@ with builtins; [
({x, y, ...}: x + "-" + y) { x = "a"; y = "b"; z = "c"; }
#=> "a-b"
+ # The entire set can be bound to a variable using `@`
+ (args@{x, y}: args.x + "-" + args.y) { x = "a"; y = "b"; }
+ #=> "a-b"
# Errors
#=========================================
@@ -355,7 +358,7 @@ with builtins; [
# its contents. You can read files from anywhere. In this example,
# we write a file into the store, and then read it back out.
(let filename = toFile "foo.txt" "hello!"; in
- [filename (builtins.readFile filename)])
+ [filename (readFile filename)])
#=> [ "/nix/store/ayh05aay2anx135prqp0cy34h891247x-foo.txt" "hello!" ]
# We can also download files into the Nix store.
@@ -373,5 +376,11 @@ with builtins; [
* [James Fisher - Nix by example - Part 1: The Nix expression language]
(https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55)
+* [Susan Potter - Nix Cookbook - Nix By Example]
+ (https://ops.functionalalgebra.com/nix-by-example/)
+
+* [Zero to Nix - Nix Tutorial]
+ (https://zero-to-nix.com/)
+
* [Rommel Martinez - A Gentle Introduction to the Nix Family]
- (https://ebzzry.io/en/nix/#nix)
+ (https://web.archive.org/web/20210121042658/https://ebzzry.io/en/nix/#nix)