@@ -7,7 +7,7 @@
771) Vorstellung des Nix Paket-Managers
88
99 - Übersicht der besonderen Features
10− - Der Paket-Store
10+ - Die Paket-Datenbank
1111 - Nix als Programmiersprache
1212
13132) Installation von Haskell-Paketen
@@ -63,7 +63,24 @@
6363- In `/nix/store` installierte Pakete referenzieren niemals
6464 Dateien außerhalb des Stores.
6565
66−# Das Nix-Programm für `parsec 3.1.3`
66+# Die Paketdatenbank
67+
68+- Nixpkgs ist eine Sammlung von Build-Rezepten, die in der rein
69+funktionalen Sprache *Nix* geschrieben sind.
70+
71+- Ein Paket wird erzeugt durch die Funktion `derivation`:
72+
73+ derivation :: String -- Arch-OS
74+ -> String -- Name-Version
75+ -> [String] -- Build-Kommando
76+ -> [StorePath] -- Abhängigkeiten
77+ -> [(String,String)] -- Shell-Umgebung
78+ -> IO StorePath
79+
80+- Nixpkgs bietet verschiedene `mkDerivation`-Wrapper, um die Verwendung
81+von `derivation` vereinfachen.
82+
83+# Das Paket `parsec 3.1.3`
6784
6885 { cabal, mtl, text }:
6986
@@ -84,10 +101,10 @@
84101 /nix/store/i0k3s...-haskell-text-ghc7.6.3-0.11.3.1
85102 /nix/store/q8163...-haskell-transformers-ghc7.6.3-0.3.0.0
86103 [...]
87− building path(s) `/nix/store/0xfxh1ncksix601m9n71fw1wkfhmsjjz-user-environment'
104+ building path(s) `/nix/store/0xfxh...-user-environment'
88105 created 22 symlinks in user environment
89106
90−# Das Nix-Programm für `yesod 1.2.1`
107+# Das Paket für `yesod 1.2.1`
91108
92109 { cabal, aeson, blazeHtml, blazeMarkup, dataDefault,
93110 , hamlet monadControl, networkConduit, safe,
@@ -106,3 +123,24 @@
106123 yesodCore yesodForm yesodPersistent
107124 ];
108125 })
126+
127+# Die Programmiersprache Nix
128+
129+- Nix ist lazy-evaluiertes ungetyptes Lambda-Kalkül.
130+
131+- Strings: `"hello world"`, `http://example.org/`
132+
133+- Listen: `[ 12 "abc" http://example.org ]`
134+
135+- Funktionen: `list: element: list ++ [element]`
136+
137+- Dictionaries: { foo = "foo"; foo = "bar; }
138+
139+- Rekursive Dictionaries:
140+
141+ rec { bar = "foo"; bar = "bar; foobar = foo + bar; }
142+
143+- Let-Statements:
144+
145+ let append = { list ? [], element }: list++[element];
146+ in append { list = ["abc" 3]; element = null; }