git.iko.soy/typeable/nix-pills-ru
on master help sign in
Initial commit
commite752830a39b8006bf3ab1a59806b55b84777594c authorAlexander Bantyev <balsoft@yandex.ru> dateSun 21 Jul 2019, 15:34 (7 years ago)
59 files changed+589
Makefile+3 architecture.png default.nix+1 images/07e910e4a018be44.pdf images/0e2457d9ab526702.pdf images/1424617b7ac7c95d.pdf images/188fdf7211acc88d.pdf images/19da3971dd333eb6.pdf images/1b1f183d83d63270.pdf images/24648988d661d96d.pdf images/24a74845eae811f8.pdf images/2ab1bef9accfd6b0.pdf images/2f58b1ea7cddeebb.pdf images/4713703a545f70d9.pdf images/4771d4d465c7d8d6.pdf images/4830188cd5dc92c1.pdf images/492d8a15398696b5.pdf images/4edcbd8378c550f8.pdf+70 images/54dbd54f7d63a297.pdf images/5b59dff014a9fc01.pdf images/5ba939cbd4bf3541.pdf images/5f808030cca24e58.pdf images/61a5a568c6312110.pdf images/6719d7c8f0674e9a.pdf images/69f31e5c6d2582b0.pdf images/6fa1eb51499dec60.pdf images/71c6154d00ce3e77.pdf images/76e53559a97fd7bf.pdf images/81e8ebffe440857c.pdf images/84f297320ced1abe.pdf+68 images/97249b599f25b363.pdf images/97cb221c7bbd7878.pdf images/9ccd45546b741322.pdf images/9e0973ce17eb93f8.pdf images/a1ffb430c5484b30.pdf images/a26eb6e8ea57450c.pdf images/a9b760021ecd34bd.pdf+69 images/ae73261c80860acf.pdf images/b1a1661668188271.pdf images/b4cecac95d5577c6.pdf images/b5eb5e2d77f27a48.pdf images/c2a15ddceeeebf53.pdf images/ce4c6b342ddaa8dc.pdf images/ce72ab0d235dbdca.pdf images/d6e8b1a4deae57d5.pdf images/d7909fc639c79f60.pdf images/d82aa8575d0021db.pdf images/e2a0d73df0d6c40a.pdf images/e2ed79f26b927b14.pdf images/f76f111a0a16a95a.pdf images/ff9616da8be506e1.pdf missfont.log+10 nix.md+333 nix.pdf nix.png nix_text.pdf nix_text.pptx result+1 shell.nix+34
Makefilenew file+3
@@ -0,0 +1,3 @@
1+loop: ; while inotifywait nix.md; do eval $$buildPhase; done
2+
3+all: loop
architecture.pngnew file

Binary file not shown.

default.nixnew file+1
@@ -0,0 +1 @@
1+shell.nix
images/07e910e4a018be44.pdfnew file

Binary file not shown.

images/0e2457d9ab526702.pdfnew file

Binary file not shown.

images/1424617b7ac7c95d.pdfnew file

Binary file not shown.

images/188fdf7211acc88d.pdfnew file

Binary file not shown.

images/19da3971dd333eb6.pdfnew file

Binary file not shown.

images/1b1f183d83d63270.pdfnew file

Binary file not shown.

images/24648988d661d96d.pdfnew file

Binary file not shown.

images/24a74845eae811f8.pdfnew file

Binary file not shown.

images/2ab1bef9accfd6b0.pdfnew file

Binary file not shown.

images/2f58b1ea7cddeebb.pdfnew file

Binary file not shown.

images/4713703a545f70d9.pdfnew file

Binary file not shown.

images/4771d4d465c7d8d6.pdfnew file

Binary file not shown.

images/4830188cd5dc92c1.pdfnew file

Binary file not shown.

images/492d8a15398696b5.pdfnew file

Binary file not shown.

images/4edcbd8378c550f8.pdfnew file+70
@@ -0,0 +1,70 @@
1+%PDF-1.5
2+%����
3+4 0 obj
4+<< /Length 5 0 R
5+ /Filter /FlateDecode
6+>>
7+stream
8+x��T�j�1 ��)�U,ɿ�^
9+��kȡ|�������K�w��$�L,iFR�1���/J)��;%�'��5>}O���I���'�kϽu����,?���)���H�!c��z�xYL�oΑ�B����hR�Wv|D F.�) 8 O�X��� �,�=R ��$$�e(�2g�[G��}�k�w
10+;Bk"EZ{q$�J'ɐ3�NS��j��N)b�(!�� j����}lhLy�� ��]q8C��?q��b:�6��������WӇ���id�D>���6�3Ԑf^#��V�2�Ğ{° ��0 ���۽<�-B����1�s"��0߃�ft�t����&�z��)raF�p 6[�{������i�������G� s��0�k�9K�ak�R�:�-g*�+��3v���$�.4WԂm�-���Vߟ�XM��3~e��^�`�{^(k�9�:r:�u����N� 䌞(��:rVď��P�e� �>���G�k��1�
11+endstream
12+endobj
13+5 0 obj
14+ 489
15+endobj
16+3 0 obj
17+<<
18+ /ExtGState <<
19+ /a0 << /CA 1 /ca 1 >>
20+ >>
21+>>
22+endobj
23+2 0 obj
24+<< /Type /Page % 1
25+ /Parent 1 0 R
26+ /MediaBox [ 0 0 500 200 ]
27+ /Contents 4 0 R
28+ /Group <<
29+ /Type /Group
30+ /S /Transparency
31+ /I true
32+ /CS /DeviceRGB
33+ >>
34+ /Resources 3 0 R
35+>>
36+endobj
37+1 0 obj
38+<< /Type /Pages
39+ /Kids [ 2 0 R ]
40+ /Count 1
41+>>
42+endobj
43+6 0 obj
44+<< /Producer (cairo 1.16.0 (https://cairographics.org))
45+ /CreationDate (D:20190721124059+03'00)
46+>>
47+endobj
48+7 0 obj
49+<< /Type /Catalog
50+ /Pages 1 0 R
51+>>
52+endobj
53+xref
54+0 8
55+0000000000 65535 f
56+0000000893 00000 n
57+0000000675 00000 n
58+0000000603 00000 n
59+0000000015 00000 n
60+0000000581 00000 n
61+0000000958 00000 n
62+0000001074 00000 n
63+trailer
64+<< /Size 8
65+ /Root 7 0 R
66+ /Info 6 0 R
67+>>
68+startxref
69+1126
70+%%EOF
images/54dbd54f7d63a297.pdfnew file

Binary file not shown.

images/5b59dff014a9fc01.pdfnew file

Binary file not shown.

images/5ba939cbd4bf3541.pdfnew file

Binary file not shown.

images/5f808030cca24e58.pdfnew file

Binary file not shown.

images/61a5a568c6312110.pdfnew file

Binary file not shown.

images/6719d7c8f0674e9a.pdfnew file

Binary file not shown.

images/69f31e5c6d2582b0.pdfnew file

Binary file not shown.

images/6fa1eb51499dec60.pdfnew file

Binary file not shown.

images/71c6154d00ce3e77.pdfnew file

Binary file not shown.

images/76e53559a97fd7bf.pdfnew file

Binary file not shown.

images/81e8ebffe440857c.pdfnew file

Binary file not shown.

images/84f297320ced1abe.pdfnew file+68
@@ -0,0 +1,68 @@
1+%PDF-1.5
2+%����
3+4 0 obj
4+<< /Length 5 0 R
5+ /Filter /FlateDecode
6+>>
7+stream
8+x�e�MJA ��9Ż�1��� �c/Ņ��H�b��ן�SՂMQ���KJ!~ԟ �y� ɯ���w�畔UjS�x����^� ,� <#ZeK ڄ=�"��1gT��`\+˦B����ʡ4.-� ,��t�{T�fnu��n��Ʉ(l�c9qҡf�:HJ75s�zo�j����>B�ޭfK�.i���#1�������&:� �Ny
9+endstream
10+endobj
11+5 0 obj
12+ 207
13+endobj
14+3 0 obj
15+<<
16+ /ExtGState <<
17+ /a0 << /CA 1 /ca 1 >>
18+ >>
19+>>
20+endobj
21+2 0 obj
22+<< /Type /Page % 1
23+ /Parent 1 0 R
24+ /MediaBox [ 0 0 500 200 ]
25+ /Contents 4 0 R
26+ /Group <<
27+ /Type /Group
28+ /S /Transparency
29+ /I true
30+ /CS /DeviceRGB
31+ >>
32+ /Resources 3 0 R
33+>>
34+endobj
35+1 0 obj
36+<< /Type /Pages
37+ /Kids [ 2 0 R ]
38+ /Count 1
39+>>
40+endobj
41+6 0 obj
42+<< /Producer (cairo 1.16.0 (https://cairographics.org))
43+ /CreationDate (D:20190721125717+03'00)
44+>>
45+endobj
46+7 0 obj
47+<< /Type /Catalog
48+ /Pages 1 0 R
49+>>
50+endobj
51+xref
52+0 8
53+0000000000 65535 f
54+0000000611 00000 n
55+0000000393 00000 n
56+0000000321 00000 n
57+0000000015 00000 n
58+0000000299 00000 n
59+0000000676 00000 n
60+0000000792 00000 n
61+trailer
62+<< /Size 8
63+ /Root 7 0 R
64+ /Info 6 0 R
65+>>
66+startxref
67+844
68+%%EOF
images/97249b599f25b363.pdfnew file

Binary file not shown.

images/97cb221c7bbd7878.pdfnew file

Binary file not shown.

images/9ccd45546b741322.pdfnew file

Binary file not shown.

images/9e0973ce17eb93f8.pdfnew file

Binary file not shown.

images/a1ffb430c5484b30.pdfnew file

Binary file not shown.

images/a26eb6e8ea57450c.pdfnew file

Binary file not shown.

images/a9b760021ecd34bd.pdfnew file+69
@@ -0,0 +1,69 @@
1+%PDF-1.5
2+%����
3+4 0 obj
4+<< /Length 5 0 R
5+ /Filter /FlateDecode
6+>>
7+stream
8+x�UNA
9+1 ����ݲ���A=���{~�n�-Jh��0�Q0�Js�$�$/a�[����-t|2���)� 舛(�G�L�Y;-`07Z@ ��s4��:$��}��'M��l�:��gѩ�+�cS�U 鱚�'e�C�B�� _�2p
10+endstream
11+endobj
12+5 0 obj
13+ 145
14+endobj
15+3 0 obj
16+<<
17+ /ExtGState <<
18+ /a0 << /CA 1 /ca 1 >>
19+ >>
20+>>
21+endobj
22+2 0 obj
23+<< /Type /Page % 1
24+ /Parent 1 0 R
25+ /MediaBox [ 0 0 500 200 ]
26+ /Contents 4 0 R
27+ /Group <<
28+ /Type /Group
29+ /S /Transparency
30+ /I true
31+ /CS /DeviceRGB
32+ >>
33+ /Resources 3 0 R
34+>>
35+endobj
36+1 0 obj
37+<< /Type /Pages
38+ /Kids [ 2 0 R ]
39+ /Count 1
40+>>
41+endobj
42+6 0 obj
43+<< /Producer (cairo 1.16.0 (https://cairographics.org))
44+ /CreationDate (D:20190721120555+03'00)
45+>>
46+endobj
47+7 0 obj
48+<< /Type /Catalog
49+ /Pages 1 0 R
50+>>
51+endobj
52+xref
53+0 8
54+0000000000 65535 f
55+0000000549 00000 n
56+0000000331 00000 n
57+0000000259 00000 n
58+0000000015 00000 n
59+0000000237 00000 n
60+0000000614 00000 n
61+0000000730 00000 n
62+trailer
63+<< /Size 8
64+ /Root 7 0 R
65+ /Info 6 0 R
66+>>
67+startxref
68+782
69+%%EOF
images/ae73261c80860acf.pdfnew file

Binary file not shown.

images/b1a1661668188271.pdfnew file

Binary file not shown.

images/b4cecac95d5577c6.pdfnew file

Binary file not shown.

images/b5eb5e2d77f27a48.pdfnew file

Binary file not shown.

images/c2a15ddceeeebf53.pdfnew file

Binary file not shown.

images/ce4c6b342ddaa8dc.pdfnew file

Binary file not shown.

images/ce72ab0d235dbdca.pdfnew file

Binary file not shown.

images/d6e8b1a4deae57d5.pdfnew file

Binary file not shown.

images/d7909fc639c79f60.pdfnew file

Binary file not shown.

images/d82aa8575d0021db.pdfnew file

Binary file not shown.

images/e2a0d73df0d6c40a.pdfnew file

Binary file not shown.

images/e2ed79f26b927b14.pdfnew file

Binary file not shown.

images/f76f111a0a16a95a.pdfnew file

Binary file not shown.

images/ff9616da8be506e1.pdfnew file

Binary file not shown.

missfont.lognew file+10
@@ -0,0 +1,10 @@
1+mktextfm noto-mono
2+mktextfm noto-mono
3+mktextfm Noto
4+mktextfm Noto
5+mktextfm noto
6+mktextfm noto
7+mktextfm NotoMono
8+mktextfm NotoMono
9+mktextfm RobotoMono
10+mktextfm RobotoMono
nix.mdnew file+333
@@ -0,0 +1,333 @@
1+---
2+title: Nix
3+subtitle: Язык, пакетный менеджер и экосистема
4+author: Александр Бантьев
5+theme: Madrid
6+colortheme: dolphin
7+mainfont: Roboto
8+monofont: Hack
9+aspectratio: 169
10+titlegraphic: nix.png
11+header-includes:
12+- \usepackage[utf8]{inputenc}
13+- \usepackage[russian]{babel}
14+---
15+
16+# Вступление
17+
18+## Что такое nix?
19+Nix - это чистый функциональный язык с динамическим типизированием и пакетный менеджер на основе этого языка.
20+
21+Философия Nix как пакетного менеджера - атомарность, повторяемость и чистота сборки.
22+
23+Как язык, Nix отличается упором на ленивые вычисления и ориентированностью на данные: большая часть кода на Nix представляет из себя напоминающие JSON множества аттрибутов (attrsets).
24+
25+## Экосистема
26+![Экосистема](architecture.png){ height=90% }
27+
28+# Nix как язык
29+
30+## Nix как язык
31+Рассмотрим основы синтаксиса Nix.
32+
33+### Краткая инструкция для желающих повторить
34+```bash
35+$ curl https://nixos.org/nix/install | sh
36+<...>
37+$ nix repl
38+```
39+
40+## Числа, арифметика и комментарии
41+```
42+nix-repl> :t 4 # Показать тип выражения
43+an integer
44+nix-repl> 1 + 2 - 3 * 2
45+-3
46+nix-repl> 1 / 2
47+0
48+nix-repl> builtins.add 1 2
49+3
50+nix-repl> # Однострочный комментарий
51+nix-repl> /* Многострочный комментарий */
52+```
53+### Замечание
54+Арифметические операторы лучше обносить пробелами! У символов `/` и `-` есть особые значения в Nix
55+```
56+nix-repl> 6/2
57+/home/balsoft/6/2
58+```
59+
60+## Булевы, булева арифметика и if
61+```
62+nix-repl> :t true
63+a boolean
64+nix-repl> true && false
65+false
66+nix-repl> true || false
67+true
68+nix-repl> if true || false then 3 else 4
69+3
70+nix-repl> if false then 5 else 6
71+6
72+```
73+
74+## Строки (strings)
75+```
76+nix-repl> "foo"
77+"foo"
78+nix-repl> :t "foo"
79+a string
80+nix-repl> "Привет"
81+"Привет"
82+nix-repl> ''foo''
83+"foo"
84+nix-repl> ''
85+ foo
86+ bar
87+ ''
88+"foo\nbar\n"
89+```
90+
91+
92+## Переменные и стороковая интерполяция
93+```
94+nix-repl> foo = "hello"
95+nix-repl> "${foo}, world!"
96+"hello, world!"
97+```
98+
99+### Замечание
100+Названия переменных могут содержать знак `-`
101+```
102+nix-repl> foo-bar = 10
103+nix-repl> foo-bar
104+10
105+```
106+Но не могут содержать не-ASCII!
107+```
108+nix-repl> привет
109+error: syntax error, unexpected $undefined, at (string):1:1
110+```
111+
112+## Как избежать интерполяции?
113+Довольно часто встречаются ситуации, когда мы хотим вставить в строку последовательность `${...}` (например, в bash-код).
114+
115+```
116+nix-repl> "\${foo}"
117+"${foo}"
118+
119+nix-repl> ''test ''${foo} test''
120+"test ${foo} test"
121+```
122+
123+## Пути (paths) и URL
124+
125+```
126+nix-repl> /bin/sh
127+/bin/sh
128+nix-repl> :t /bin/sh
129+a path
130+nix-repl> ./hello # Относительно текущего .nix файла или PWD для repl
131+/home/balsoft/hello
132+nix-repl> https://typeable.io
133+"https://typeable.io"
134+nix-repl> :t https://typeable.io
135+a string
136+```
137+### Замечание
138+Пути, как и названия переменных, не могут содержать не-ASCII. Я бы рассматривал это, как баг.
139+```
140+nix-repl> /home/balsoft/Документы
141+error: path '/home/balsoft/' has a trailing slash
142+```
143+
144+## Списки (lists)
145+
146+Списки в Nix иммутабельны и могут содержать значения любых типов вперемешку.
147+
148+```
149+nix-repl> [ 2 "foo" true (2+3) ]
150+[ 2 "foo" true 5 ]
151+
152+```
153+
154+### Замечание
155+Обратите внимание: элементы списка не разделены запятыми!
156+```
157+nix-repl> [ 1 + 2 ]
158+error: syntax error, unexpected '+', at (string):1:5
159+nix-repl> [ (1 + 2) ]
160+[ 3 ]
161+nix-repl> [ import ./hello.nix {} ]
162+[ «primop-app» /home/balsoft/hello.nix { ... } ]
163+```
164+
165+## Множества аттрибутов (attribute sets, attrsets)
166+```
167+nix-repl> s = { foo = "bar"; a-b = "baz"; "123" = "num"; }
168+nix-repl> s
169+{ "123" = "num"; a-b = "baz"; foo = "bar"; }
170+nix-repl> s.a-b
171+"baz"
172+nix-repl> s."123"
173+"num"
174+nix-repl> s.${toString (122 + 1)}
175+"num"
176+nix-repl> s.abc or "not found" # Note that `or` is a keyword
177+"not found"
178+nix-repl> s // { a = 10; }
179+{ "123" = "num"; a = 10; a-b = "baz"; foo = "bar"; }
180+nix-repl> rec { a = 3; b = a + 4; } # Recursive attrset
181+{ a = 3; b = 7; }
182+```
183+
184+
185+## Let и with
186+```
187+nix-repl> let a = 3; b = 4; in a + b
188+7
189+nix-repl> let a = 4; b = a + 5; in b # Let definitions are recursive
190+9
191+nix-repl> let a = 3; a = 8; in a
192+error: attribute `a' at (string):1:12 already defined at (string):1:5
193+nix-repl> longName = { a = 3; b = 4; }
194+nix-repl> longName.a + longName.b
195+7
196+nix-repl> with longName; a + b
197+7
198+```
199+
200+## Функции (functions)
201+```
202+nix-repl> x: x*2
203+«lambda»
204+nix-repl> double = x: x * 2
205+nix-repl> :t double
206+a function
207+nix-repl> double 3
208+6
209+nix-repl> greet = end: name: "Hello, ${name} ${end}"
210+nix-repl> greet "dredozubov" "!"
211+"Hello, dredozubov !"
212+nix-repl> greetExclamaition = greet "!"
213+nix-repl> greetExclamaition "s9gf4ult"
214+"Hello, s9gf4ult !"
215+```
216+
217+## Паттерн-матчинг
218+```
219+nix-repl> greet = { name, end }: "Hello, ${name} ${end}"
220+nix-repl> greet { name = "ak3n"; exc = "!"; }
221+"Hello, ak3n !"
222+nix-repl> greet = { name, end ? "!" }: "Hello, ${name} ${end}"
223+nix-repl> greet { name = "ak3n"; }
224+"Hello, ak3n !"
225+nix-repl> greet { name = "ak3n"; end = "."; }
226+"Hello, ak3n ."
227+nix-repl> greet = { name, end ? "!", ... }: "Hello, ${name} ${end}"
228+nix-repl> greet { name = "ak3n"; end = "."; extra = true; }
229+"Hello, ak3n ."
230+nix-repl> foo = {a, ...}@args: args // { a = a + 3; }
231+nix-repl> foo { a = 10; b = 11; }
232+{ a = 13; b = 11; }
233+```
234+
235+## Подключения файлов (import)
236+### number.nix
237+```
238+3
239+```
240+### function.nix
241+```
242+a: a + 3
243+```
244+### Обратно в наш уютный repl
245+```
246+nix-repl> a = import ./number.nix
247+nix-repl> f = import ./function.nix
248+nix-repl> f a
249+6
250+```
251+
252+## Деривации (derivation)
253+```
254+nix-repl> d = derivation {
255+ name = "myname";
256+ builder = "mybuilder";
257+ system = "mysystem";
258+ }
259+nix-repl> :t d
260+a set
261+nix-repl> d
262+«derivation /nix/store/z3hhlxbckx4g3n9sw91nnvlkjvyw754p-myname.drv»
263+```
264+
265+### Лирическое отступление
266+На этом этапе нужно рассмотреть, что же представляет из себя nix-the-package-manager.
267+
268+# Пакетный менеджер Nix
269+## Хранилище (nix store)
270+> In the beginning was the Store, and the Store was with Nix, and the Store was Nix.
271+
272+*-- Nix manual, 1:1*
273+
274+```bash
275+$ ls /nix/store | wc -l
276+46251
277+$ nix add-to-store nix.conf
278+/nix/store/za34q8y0jcx3qsrnbrd005mh8zcnlrlr-nix.conf
279+
280+```
281+
282+## Деривации
283+```bash
284+$ cat /nix/store/z3hhlxbckx4g3n9sw91nnvlkjvyw754p-myname.drv
285+Derive
286+([("out","/nix/store/40s0qmrfb45vlh6610rk29ym318dswdr-myname","","")]
287+,[]
288+,[]
289+,"mysystem"
290+,"mybuilder"
291+,[]
292+,[("builder","mybuilder")
293+ ,("name","myname")
294+ ,("out","/nix/store/40s0qmrfb45vlh6610rk29ym318dswdr-myname")
295+ ,("system","mysystem") ] )
296+```
297+
298+## Принцип работы
299+```diagram
300+text' s t = text t # fontSize (local s) <> strutY (s * 1.3)
301+
302+
303+sideText' s t = baselineText t # fontSize (local s)
304+
305+box t = text' 0.2 t # fc white # font "hack" <> roundedRect 2 0.4 0.2 # fc blue
306+
307+av = unitY ^* (-0.5)
308+
309+boxes = box "myname.nix" # named "nix"
310+ ===
311+ (strutY 0.5 <> sideText' 0.1 "Вычисление (nix как язык)")
312+ ===
313+ box "myname.drv" # named "drv"
314+ ===
315+ (strutY 0.5 <> sideText' 0.1 "Сборка (nix как пакетный менеджер)")
316+ ===
317+ box " myname " # named "out"
318+
319+arrows = arrowBetween (0 ^& (-0.2)) (0 ^& (-0.7))
320+ <> arrowBetween (0 ^& (-1.1)) (0 ^& (-1.6))
321+
322+example = boxes <> arrows
323+```
324+
325+*На эту диаграмму ушло четыре с половиной часа. Ненавижу `diagrams`, `diagrams-pandoc` и `svg-fonts`*
326+
327+
328+# Заключение
329+## Ссылки
330+https://nixos.org/
331+https://imgur.com/0gPQ4zg
332+
333+
nix.pdfnew file

Binary file not shown.

nix.pngnew file

Binary file not shown.

nix_text.pdfnew file

Binary file not shown.

nix_text.pptxnew file

Binary file not shown.

resultnew file+1
@@ -0,0 +1 @@
1+/nix/store/ama6q6ryavwxazc4p2m526zppbgg5qdh-presentation
shell.nixnew file+34
@@ -0,0 +1,34 @@
1+with import <nixpkgs> { };
2+let
3+ diagrams-pandoc = (haskell.lib.doJailbreak
4+ (haskellPackages.diagrams-pandoc.overrideAttrs
5+ (_: { meta.isBroken = false; })));
6+ ghcDiagrams = ghc.withPackages (ps: with ps; [ diagrams-lib diagrams-builder diagrams-core SVGFonts ]);
7+in stdenv.mkDerivation rec {
8+ name = "presentation";
9+ buildInputs = [
10+ pandoc
11+ texlive.combined.scheme-full
12+ diagrams-pandoc
13+ fontconfig
14+ roboto
15+ hack-font
16+
17+ inotify-tools
18+ ];
19+
20+ NIX_GHC = "${ghcDiagrams}/bin/ghc";
21+ NIX_GHC_LIBDIR = "${ghcDiagrams}/lib/ghc-${ghcDiagrams.version}";
22+
23+ FONTCONFIG_PATH = "${/etc/fonts}";
24+
25+ src = ./.;
26+
27+ phases = [ "buildPhase" ];
28+
29+ preferLocalBuild = true;
30+
31+ buildPhase = ''
32+ pandoc nix.md -t beamer --pdf-engine xelatex --filter diagrams-pandoc -o nix.pdf
33+ '';
34+}