diff options
Diffstat (limited to 'util/nix')
-rw-r--r-- | util/nix/poetry.lock | 468 | ||||
-rw-r--r-- | util/nix/pyproject.toml | 36 | ||||
-rw-r--r-- | util/nix/sources.json | 38 | ||||
-rw-r--r-- | util/nix/sources.nix | 174 |
4 files changed, 716 insertions, 0 deletions
diff --git a/util/nix/poetry.lock b/util/nix/poetry.lock new file mode 100644 index 000000000..9bb0f64de --- /dev/null +++ b/util/nix/poetry.lock | |||
@@ -0,0 +1,468 @@ | |||
1 | [[package]] | ||
2 | name = "appdirs" | ||
3 | version = "1.4.4" | ||
4 | description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." | ||
5 | category = "main" | ||
6 | optional = false | ||
7 | python-versions = "*" | ||
8 | |||
9 | [[package]] | ||
10 | name = "argcomplete" | ||
11 | version = "1.12.3" | ||
12 | description = "Bash tab completion for argparse" | ||
13 | category = "main" | ||
14 | optional = false | ||
15 | python-versions = "*" | ||
16 | |||
17 | [package.extras] | ||
18 | test = ["coverage", "flake8", "pexpect", "wheel"] | ||
19 | |||
20 | [[package]] | ||
21 | name = "attrs" | ||
22 | version = "21.2.0" | ||
23 | description = "Classes Without Boilerplate" | ||
24 | category = "main" | ||
25 | optional = false | ||
26 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" | ||
27 | |||
28 | [package.extras] | ||
29 | dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] | ||
30 | docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] | ||
31 | tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] | ||
32 | tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] | ||
33 | |||
34 | [[package]] | ||
35 | name = "colorama" | ||
36 | version = "0.4.4" | ||
37 | description = "Cross-platform colored terminal text." | ||
38 | category = "main" | ||
39 | optional = false | ||
40 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" | ||
41 | |||
42 | [[package]] | ||
43 | name = "coverage" | ||
44 | version = "5.5" | ||
45 | description = "Code coverage measurement for Python" | ||
46 | category = "dev" | ||
47 | optional = false | ||
48 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" | ||
49 | |||
50 | [package.extras] | ||
51 | toml = ["toml"] | ||
52 | |||
53 | [[package]] | ||
54 | name = "flake8" | ||
55 | version = "3.9.2" | ||
56 | description = "the modular source code checker: pep8 pyflakes and co" | ||
57 | category = "dev" | ||
58 | optional = false | ||
59 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" | ||
60 | |||
61 | [package.dependencies] | ||
62 | mccabe = ">=0.6.0,<0.7.0" | ||
63 | pycodestyle = ">=2.7.0,<2.8.0" | ||
64 | pyflakes = ">=2.3.0,<2.4.0" | ||
65 | |||
66 | [[package]] | ||
67 | name = "flake8-polyfill" | ||
68 | version = "1.0.2" | ||
69 | description = "Polyfill package for Flake8 plugins" | ||
70 | category = "dev" | ||
71 | optional = false | ||
72 | python-versions = "*" | ||
73 | |||
74 | [package.dependencies] | ||
75 | flake8 = "*" | ||
76 | |||
77 | [[package]] | ||
78 | name = "halo" | ||
79 | version = "0.0.31" | ||
80 | description = "Beautiful terminal spinners in Python" | ||
81 | category = "main" | ||
82 | optional = false | ||
83 | python-versions = ">=3.4" | ||
84 | |||
85 | [package.dependencies] | ||
86 | colorama = ">=0.3.9" | ||
87 | log-symbols = ">=0.0.14" | ||
88 | six = ">=1.12.0" | ||
89 | spinners = ">=0.0.24" | ||
90 | termcolor = ">=1.1.0" | ||
91 | |||
92 | [package.extras] | ||
93 | ipython = ["IPython (==5.7.0)", "ipywidgets (==7.1.0)"] | ||
94 | |||
95 | [[package]] | ||
96 | name = "hid" | ||
97 | version = "1.0.4" | ||
98 | description = "ctypes bindings for hidapi" | ||
99 | category = "main" | ||
100 | optional = false | ||
101 | python-versions = "*" | ||
102 | |||
103 | [[package]] | ||
104 | name = "hjson" | ||
105 | version = "3.0.2" | ||
106 | description = "Hjson, a user interface for JSON." | ||
107 | category = "main" | ||
108 | optional = false | ||
109 | python-versions = "*" | ||
110 | |||
111 | [[package]] | ||
112 | name = "jsonschema" | ||
113 | version = "3.2.0" | ||
114 | description = "An implementation of JSON Schema validation for Python" | ||
115 | category = "main" | ||
116 | optional = false | ||
117 | python-versions = "*" | ||
118 | |||
119 | [package.dependencies] | ||
120 | attrs = ">=17.4.0" | ||
121 | pyrsistent = ">=0.14.0" | ||
122 | six = ">=1.11.0" | ||
123 | |||
124 | [package.extras] | ||
125 | format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] | ||
126 | format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"] | ||
127 | |||
128 | [[package]] | ||
129 | name = "log-symbols" | ||
130 | version = "0.0.14" | ||
131 | description = "Colored symbols for various log levels for Python" | ||
132 | category = "main" | ||
133 | optional = false | ||
134 | python-versions = "*" | ||
135 | |||
136 | [package.dependencies] | ||
137 | colorama = ">=0.3.9" | ||
138 | |||
139 | [[package]] | ||
140 | name = "mccabe" | ||
141 | version = "0.6.1" | ||
142 | description = "McCabe checker, plugin for flake8" | ||
143 | category = "dev" | ||
144 | optional = false | ||
145 | python-versions = "*" | ||
146 | |||
147 | [[package]] | ||
148 | name = "milc" | ||
149 | version = "1.6.2" | ||
150 | description = "Opinionated Batteries-Included Python 3 CLI Framework." | ||
151 | category = "main" | ||
152 | optional = false | ||
153 | python-versions = "*" | ||
154 | |||
155 | [package.dependencies] | ||
156 | appdirs = "*" | ||
157 | argcomplete = "*" | ||
158 | colorama = "*" | ||
159 | halo = "*" | ||
160 | spinners = "*" | ||
161 | |||
162 | [[package]] | ||
163 | name = "nose2" | ||
164 | version = "0.10.0" | ||
165 | description = "unittest2 with plugins, the succesor to nose" | ||
166 | category = "dev" | ||
167 | optional = false | ||
168 | python-versions = "*" | ||
169 | |||
170 | [package.dependencies] | ||
171 | coverage = ">=4.4.1" | ||
172 | six = ">=1.7" | ||
173 | |||
174 | [package.extras] | ||
175 | coverage_plugin = ["coverage (>=4.4.1)"] | ||
176 | dev = ["Sphinx (>=1.6.5)", "sphinx-rtd-theme", "mock", "coverage"] | ||
177 | |||
178 | [[package]] | ||
179 | name = "pep8-naming" | ||
180 | version = "0.12.1" | ||
181 | description = "Check PEP-8 naming conventions, plugin for flake8" | ||
182 | category = "dev" | ||
183 | optional = false | ||
184 | python-versions = "*" | ||
185 | |||
186 | [package.dependencies] | ||
187 | flake8 = ">=3.9.1" | ||
188 | flake8-polyfill = ">=1.0.2,<2" | ||
189 | |||
190 | [[package]] | ||
191 | name = "pycodestyle" | ||
192 | version = "2.7.0" | ||
193 | description = "Python style guide checker" | ||
194 | category = "dev" | ||
195 | optional = false | ||
196 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" | ||
197 | |||
198 | [[package]] | ||
199 | name = "pyflakes" | ||
200 | version = "2.3.1" | ||
201 | description = "passive checker of Python programs" | ||
202 | category = "dev" | ||
203 | optional = false | ||
204 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" | ||
205 | |||
206 | [[package]] | ||
207 | name = "pygments" | ||
208 | version = "2.10.0" | ||
209 | description = "Pygments is a syntax highlighting package written in Python." | ||
210 | category = "main" | ||
211 | optional = false | ||
212 | python-versions = ">=3.5" | ||
213 | |||
214 | [[package]] | ||
215 | name = "pyrsistent" | ||
216 | version = "0.18.0" | ||
217 | description = "Persistent/Functional/Immutable data structures" | ||
218 | category = "main" | ||
219 | optional = false | ||
220 | python-versions = ">=3.6" | ||
221 | |||
222 | [[package]] | ||
223 | name = "pyusb" | ||
224 | version = "1.2.1" | ||
225 | description = "Python USB access module" | ||
226 | category = "main" | ||
227 | optional = false | ||
228 | python-versions = ">=3.6.0" | ||
229 | |||
230 | [[package]] | ||
231 | name = "qmk" | ||
232 | version = "1.0.0" | ||
233 | description = "A program to help users work with QMK Firmware." | ||
234 | category = "main" | ||
235 | optional = false | ||
236 | python-versions = "*" | ||
237 | |||
238 | [package.dependencies] | ||
239 | hid = "*" | ||
240 | hjson = "*" | ||
241 | jsonschema = ">=3" | ||
242 | milc = ">=1.4.2" | ||
243 | pygments = "*" | ||
244 | pyusb = "*" | ||
245 | qmk-dotty-dict = "*" | ||
246 | |||
247 | [[package]] | ||
248 | name = "qmk-dotty-dict" | ||
249 | version = "1.3.0.post1" | ||
250 | description = "Dictionary wrapper for quick access to deeply nested keys." | ||
251 | category = "main" | ||
252 | optional = false | ||
253 | python-versions = "*" | ||
254 | |||
255 | [[package]] | ||
256 | name = "six" | ||
257 | version = "1.16.0" | ||
258 | description = "Python 2 and 3 compatibility utilities" | ||
259 | category = "main" | ||
260 | optional = false | ||
261 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" | ||
262 | |||
263 | [[package]] | ||
264 | name = "spinners" | ||
265 | version = "0.0.24" | ||
266 | description = "Spinners for terminals" | ||
267 | category = "main" | ||
268 | optional = false | ||
269 | python-versions = "*" | ||
270 | |||
271 | [[package]] | ||
272 | name = "termcolor" | ||
273 | version = "1.1.0" | ||
274 | description = "ANSII Color formatting for output in terminal." | ||
275 | category = "main" | ||
276 | optional = false | ||
277 | python-versions = "*" | ||
278 | |||
279 | [[package]] | ||
280 | name = "yapf" | ||
281 | version = "0.31.0" | ||
282 | description = "A formatter for Python code." | ||
283 | category = "dev" | ||
284 | optional = false | ||
285 | python-versions = "*" | ||
286 | |||
287 | [metadata] | ||
288 | lock-version = "1.1" | ||
289 | python-versions = "^3.8" | ||
290 | content-hash = "468ae51aaddfe2ce62938f131c688bbc447e41608d4dd7d30db36391c38bda20" | ||
291 | |||
292 | [metadata.files] | ||
293 | appdirs = [ | ||
294 | {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, | ||
295 | {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, | ||
296 | ] | ||
297 | argcomplete = [ | ||
298 | {file = "argcomplete-1.12.3-py2.py3-none-any.whl", hash = "sha256:291f0beca7fd49ce285d2f10e4c1c77e9460cf823eef2de54df0c0fec88b0d81"}, | ||
299 | {file = "argcomplete-1.12.3.tar.gz", hash = "sha256:2c7dbffd8c045ea534921e63b0be6fe65e88599990d8dc408ac8c542b72a5445"}, | ||
300 | ] | ||
301 | attrs = [ | ||
302 | {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, | ||
303 | {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, | ||
304 | ] | ||
305 | colorama = [ | ||
306 | {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, | ||
307 | {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, | ||
308 | ] | ||
309 | coverage = [ | ||
310 | {file = "coverage-5.5-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf"}, | ||
311 | {file = "coverage-5.5-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b"}, | ||
312 | {file = "coverage-5.5-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669"}, | ||
313 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90"}, | ||
314 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c"}, | ||
315 | {file = "coverage-5.5-cp27-cp27m-win32.whl", hash = "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a"}, | ||
316 | {file = "coverage-5.5-cp27-cp27m-win_amd64.whl", hash = "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82"}, | ||
317 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905"}, | ||
318 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083"}, | ||
319 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5"}, | ||
320 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81"}, | ||
321 | {file = "coverage-5.5-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6"}, | ||
322 | {file = "coverage-5.5-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0"}, | ||
323 | {file = "coverage-5.5-cp310-cp310-win_amd64.whl", hash = "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae"}, | ||
324 | {file = "coverage-5.5-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb"}, | ||
325 | {file = "coverage-5.5-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160"}, | ||
326 | {file = "coverage-5.5-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6"}, | ||
327 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701"}, | ||
328 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793"}, | ||
329 | {file = "coverage-5.5-cp35-cp35m-win32.whl", hash = "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e"}, | ||
330 | {file = "coverage-5.5-cp35-cp35m-win_amd64.whl", hash = "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3"}, | ||
331 | {file = "coverage-5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066"}, | ||
332 | {file = "coverage-5.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a"}, | ||
333 | {file = "coverage-5.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465"}, | ||
334 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb"}, | ||
335 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821"}, | ||
336 | {file = "coverage-5.5-cp36-cp36m-win32.whl", hash = "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45"}, | ||
337 | {file = "coverage-5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184"}, | ||
338 | {file = "coverage-5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a"}, | ||
339 | {file = "coverage-5.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53"}, | ||
340 | {file = "coverage-5.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d"}, | ||
341 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638"}, | ||
342 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3"}, | ||
343 | {file = "coverage-5.5-cp37-cp37m-win32.whl", hash = "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a"}, | ||
344 | {file = "coverage-5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a"}, | ||
345 | {file = "coverage-5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6"}, | ||
346 | {file = "coverage-5.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2"}, | ||
347 | {file = "coverage-5.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759"}, | ||
348 | {file = "coverage-5.5-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873"}, | ||
349 | {file = "coverage-5.5-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a"}, | ||
350 | {file = "coverage-5.5-cp38-cp38-win32.whl", hash = "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6"}, | ||
351 | {file = "coverage-5.5-cp38-cp38-win_amd64.whl", hash = "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502"}, | ||
352 | {file = "coverage-5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b"}, | ||
353 | {file = "coverage-5.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529"}, | ||
354 | {file = "coverage-5.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b"}, | ||
355 | {file = "coverage-5.5-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff"}, | ||
356 | {file = "coverage-5.5-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b"}, | ||
357 | {file = "coverage-5.5-cp39-cp39-win32.whl", hash = "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6"}, | ||
358 | {file = "coverage-5.5-cp39-cp39-win_amd64.whl", hash = "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03"}, | ||
359 | {file = "coverage-5.5-pp36-none-any.whl", hash = "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079"}, | ||
360 | {file = "coverage-5.5-pp37-none-any.whl", hash = "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4"}, | ||
361 | {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}, | ||
362 | ] | ||
363 | flake8 = [ | ||
364 | {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, | ||
365 | {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, | ||
366 | ] | ||
367 | flake8-polyfill = [ | ||
368 | {file = "flake8-polyfill-1.0.2.tar.gz", hash = "sha256:e44b087597f6da52ec6393a709e7108b2905317d0c0b744cdca6208e670d8eda"}, | ||
369 | {file = "flake8_polyfill-1.0.2-py2.py3-none-any.whl", hash = "sha256:12be6a34ee3ab795b19ca73505e7b55826d5f6ad7230d31b18e106400169b9e9"}, | ||
370 | ] | ||
371 | halo = [ | ||
372 | {file = "halo-0.0.31-py2-none-any.whl", hash = "sha256:5350488fb7d2aa7c31a1344120cee67a872901ce8858f60da7946cef96c208ab"}, | ||
373 | {file = "halo-0.0.31.tar.gz", hash = "sha256:7b67a3521ee91d53b7152d4ee3452811e1d2a6321975137762eb3d70063cc9d6"}, | ||
374 | ] | ||
375 | hid = [ | ||
376 | {file = "hid-1.0.4-py2-none-any.whl", hash = "sha256:fba9913f07030b01059b822b24c83b370ca3f444e9e6443bd662f9f1aa3f0780"}, | ||
377 | {file = "hid-1.0.4.tar.gz", hash = "sha256:f61b0382f37a334bc8ba8604bc84b94875ee4f594fbbaf82b2c3b3e827883fc1"}, | ||
378 | ] | ||
379 | hjson = [ | ||
380 | {file = "hjson-3.0.2-py3-none-any.whl", hash = "sha256:5546438bf4e1b52bc964c6a47c4ed10fa5fba8a1b264e22efa893e333baad2db"}, | ||
381 | {file = "hjson-3.0.2.tar.gz", hash = "sha256:2838fd7200e5839ea4516ece953f3a19892c41089f0d933ba3f68e596aacfcd5"}, | ||
382 | ] | ||
383 | jsonschema = [ | ||
384 | {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, | ||
385 | {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, | ||
386 | ] | ||
387 | log-symbols = [ | ||
388 | {file = "log_symbols-0.0.14-py3-none-any.whl", hash = "sha256:4952106ff8b605ab7d5081dd2c7e6ca7374584eff7086f499c06edd1ce56dcca"}, | ||
389 | {file = "log_symbols-0.0.14.tar.gz", hash = "sha256:cf0bbc6fe1a8e53f0d174a716bc625c4f87043cc21eb55dd8a740cfe22680556"}, | ||
390 | ] | ||
391 | mccabe = [ | ||
392 | {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, | ||
393 | {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, | ||
394 | ] | ||
395 | milc = [ | ||
396 | {file = "milc-1.6.2-py2.py3-none-any.whl", hash = "sha256:cb26404c7f3d6797c9c42005de732161e45e21294cde85845e914b279321bdad"}, | ||
397 | {file = "milc-1.6.2.tar.gz", hash = "sha256:779710a0b9300bef3c5748158887e6c734659e147d55548d9e4701d7a7d5dddf"}, | ||
398 | ] | ||
399 | nose2 = [ | ||
400 | {file = "nose2-0.10.0-py2.py3-none-any.whl", hash = "sha256:aa620e759f2c5018d9ba041340391913e282ecebd3c392027f1575847b093ec6"}, | ||
401 | {file = "nose2-0.10.0.tar.gz", hash = "sha256:886ba617a96de0130c54b24479bd5c2d74d5c940d40f3809c3a275511a0c4a60"}, | ||
402 | ] | ||
403 | pep8-naming = [ | ||
404 | {file = "pep8-naming-0.12.1.tar.gz", hash = "sha256:bb2455947757d162aa4cad55dba4ce029005cd1692f2899a21d51d8630ca7841"}, | ||
405 | {file = "pep8_naming-0.12.1-py2.py3-none-any.whl", hash = "sha256:4a8daeaeb33cfcde779309fc0c9c0a68a3bbe2ad8a8308b763c5068f86eb9f37"}, | ||
406 | ] | ||
407 | pycodestyle = [ | ||
408 | {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, | ||
409 | {file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"}, | ||
410 | ] | ||
411 | pyflakes = [ | ||
412 | {file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"}, | ||
413 | {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, | ||
414 | ] | ||
415 | pygments = [ | ||
416 | {file = "Pygments-2.10.0-py3-none-any.whl", hash = "sha256:b8e67fe6af78f492b3c4b3e2970c0624cbf08beb1e493b2c99b9fa1b67a20380"}, | ||
417 | {file = "Pygments-2.10.0.tar.gz", hash = "sha256:f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6"}, | ||
418 | ] | ||
419 | pyrsistent = [ | ||
420 | {file = "pyrsistent-0.18.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f4c8cabb46ff8e5d61f56a037974228e978f26bfefce4f61a4b1ac0ba7a2ab72"}, | ||
421 | {file = "pyrsistent-0.18.0-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:da6e5e818d18459fa46fac0a4a4e543507fe1110e808101277c5a2b5bab0cd2d"}, | ||
422 | {file = "pyrsistent-0.18.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:5e4395bbf841693eaebaa5bb5c8f5cdbb1d139e07c975c682ec4e4f8126e03d2"}, | ||
423 | {file = "pyrsistent-0.18.0-cp36-cp36m-win32.whl", hash = "sha256:527be2bfa8dc80f6f8ddd65242ba476a6c4fb4e3aedbf281dfbac1b1ed4165b1"}, | ||
424 | {file = "pyrsistent-0.18.0-cp36-cp36m-win_amd64.whl", hash = "sha256:2aaf19dc8ce517a8653746d98e962ef480ff34b6bc563fc067be6401ffb457c7"}, | ||
425 | {file = "pyrsistent-0.18.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:58a70d93fb79dc585b21f9d72487b929a6fe58da0754fa4cb9f279bb92369396"}, | ||
426 | {file = "pyrsistent-0.18.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:4916c10896721e472ee12c95cdc2891ce5890898d2f9907b1b4ae0f53588b710"}, | ||
427 | {file = "pyrsistent-0.18.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:73ff61b1411e3fb0ba144b8f08d6749749775fe89688093e1efef9839d2dcc35"}, | ||
428 | {file = "pyrsistent-0.18.0-cp37-cp37m-win32.whl", hash = "sha256:b29b869cf58412ca5738d23691e96d8aff535e17390128a1a52717c9a109da4f"}, | ||
429 | {file = "pyrsistent-0.18.0-cp37-cp37m-win_amd64.whl", hash = "sha256:097b96f129dd36a8c9e33594e7ebb151b1515eb52cceb08474c10a5479e799f2"}, | ||
430 | {file = "pyrsistent-0.18.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:772e94c2c6864f2cd2ffbe58bb3bdefbe2a32afa0acb1a77e472aac831f83427"}, | ||
431 | {file = "pyrsistent-0.18.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:c1a9ff320fa699337e05edcaae79ef8c2880b52720bc031b219e5b5008ebbdef"}, | ||
432 | {file = "pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:cd3caef37a415fd0dae6148a1b6957a8c5f275a62cca02e18474608cb263640c"}, | ||
433 | {file = "pyrsistent-0.18.0-cp38-cp38-win32.whl", hash = "sha256:e79d94ca58fcafef6395f6352383fa1a76922268fa02caa2272fff501c2fdc78"}, | ||
434 | {file = "pyrsistent-0.18.0-cp38-cp38-win_amd64.whl", hash = "sha256:a0c772d791c38bbc77be659af29bb14c38ced151433592e326361610250c605b"}, | ||
435 | {file = "pyrsistent-0.18.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d5ec194c9c573aafaceebf05fc400656722793dac57f254cd4741f3c27ae57b4"}, | ||
436 | {file = "pyrsistent-0.18.0-cp39-cp39-manylinux1_i686.whl", hash = "sha256:6b5eed00e597b5b5773b4ca30bd48a5774ef1e96f2a45d105db5b4ebb4bca680"}, | ||
437 | {file = "pyrsistent-0.18.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:48578680353f41dca1ca3dc48629fb77dfc745128b56fc01096b2530c13fd426"}, | ||
438 | {file = "pyrsistent-0.18.0-cp39-cp39-win32.whl", hash = "sha256:f3ef98d7b76da5eb19c37fda834d50262ff9167c65658d1d8f974d2e4d90676b"}, | ||
439 | {file = "pyrsistent-0.18.0-cp39-cp39-win_amd64.whl", hash = "sha256:404e1f1d254d314d55adb8d87f4f465c8693d6f902f67eb6ef5b4526dc58e6ea"}, | ||
440 | {file = "pyrsistent-0.18.0.tar.gz", hash = "sha256:773c781216f8c2900b42a7b638d5b517bb134ae1acbebe4d1e8f1f41ea60eb4b"}, | ||
441 | ] | ||
442 | pyusb = [ | ||
443 | {file = "pyusb-1.2.1-py3-none-any.whl", hash = "sha256:2b4c7cb86dbadf044dfb9d3a4ff69fd217013dbe78a792177a3feb172449ea36"}, | ||
444 | {file = "pyusb-1.2.1.tar.gz", hash = "sha256:a4cc7404a203144754164b8b40994e2849fde1cfff06b08492f12fff9d9de7b9"}, | ||
445 | ] | ||
446 | qmk = [ | ||
447 | {file = "qmk-1.0.0-py2.py3-none-any.whl", hash = "sha256:63d69b97a533d91b0cfa7887e68cac7df52c6f7bddf4bf44d17ef1241d85ffff"}, | ||
448 | {file = "qmk-1.0.0.tar.gz", hash = "sha256:da62eec73c4548cc37b0b9be3937202dc3a301dc2f2663610ecca751a610f9ca"}, | ||
449 | ] | ||
450 | qmk-dotty-dict = [ | ||
451 | {file = "qmk_dotty_dict-1.3.0.post1-py3-none-any.whl", hash = "sha256:a9cb7fc3ff9631190fee0ecac14986a0ac7b4b6892347dc9d7486a4c4ea24492"}, | ||
452 | {file = "qmk_dotty_dict-1.3.0.post1.tar.gz", hash = "sha256:3b611e393660bfaa6835c68e94784bae80fe07b8490978b5ecab03a0d2fc7ea2"}, | ||
453 | ] | ||
454 | six = [ | ||
455 | {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, | ||
456 | {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, | ||
457 | ] | ||
458 | spinners = [ | ||
459 | {file = "spinners-0.0.24-py3-none-any.whl", hash = "sha256:2fa30d0b72c9650ad12bbe031c9943b8d441e41b4f5602b0ec977a19f3290e98"}, | ||
460 | {file = "spinners-0.0.24.tar.gz", hash = "sha256:1eb6aeb4781d72ab42ed8a01dcf20f3002bf50740d7154d12fb8c9769bf9e27f"}, | ||
461 | ] | ||
462 | termcolor = [ | ||
463 | {file = "termcolor-1.1.0.tar.gz", hash = "sha256:1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b"}, | ||
464 | ] | ||
465 | yapf = [ | ||
466 | {file = "yapf-0.31.0-py2.py3-none-any.whl", hash = "sha256:e3a234ba8455fe201eaa649cdac872d590089a18b661e39bbac7020978dd9c2e"}, | ||
467 | {file = "yapf-0.31.0.tar.gz", hash = "sha256:408fb9a2b254c302f49db83c59f9aa0b4b0fd0ec25be3a5c51181327922ff63d"}, | ||
468 | ] | ||
diff --git a/util/nix/pyproject.toml b/util/nix/pyproject.toml new file mode 100644 index 000000000..1ec8aacd4 --- /dev/null +++ b/util/nix/pyproject.toml | |||
@@ -0,0 +1,36 @@ | |||
1 | # This file should be kept in sync with requirements.txt and requirements-dev.txt | ||
2 | # It is particularly required by the Nix environment (see shell.nix). To update versions, | ||
3 | # normally one would run "poetry update --lock" | ||
4 | [tool.poetry] | ||
5 | name = "qmk_firmware" | ||
6 | version = "0.1.0" | ||
7 | description = "" | ||
8 | authors = [] | ||
9 | |||
10 | [tool.poetry.dependencies] | ||
11 | python = "^3.8" | ||
12 | appdirs = "*" | ||
13 | argcomplete = "*" | ||
14 | colorama = "*" | ||
15 | hid = "*" | ||
16 | hjson = "*" | ||
17 | jsonschema = ">=3" | ||
18 | milc = ">=1.4.2" | ||
19 | Pygments = "*" | ||
20 | pyusb = "*" | ||
21 | qmk-dotty-dict = "*" | ||
22 | |||
23 | # This dependency is not mentioned in requirements.txt (QMK CLI is not a | ||
24 | # library package that is required by the Python code in qmk_firmware), but is | ||
25 | # required to build a proper nix-shell environment. | ||
26 | qmk = "*" | ||
27 | |||
28 | [tool.poetry.dev-dependencies] | ||
29 | nose2 = "*" | ||
30 | flake8 = "*" | ||
31 | pep8-naming = "*" | ||
32 | yapf = "*" | ||
33 | |||
34 | [build-system] | ||
35 | requires = ["poetry-core>=1.0.0"] | ||
36 | build-backend = "poetry.core.masonry.api" | ||
diff --git a/util/nix/sources.json b/util/nix/sources.json new file mode 100644 index 000000000..caf5cb7d2 --- /dev/null +++ b/util/nix/sources.json | |||
@@ -0,0 +1,38 @@ | |||
1 | { | ||
2 | "niv": { | ||
3 | "branch": "master", | ||
4 | "description": "Easy dependency management for Nix projects", | ||
5 | "homepage": "https://github.com/nmattia/niv", | ||
6 | "owner": "nmattia", | ||
7 | "repo": "niv", | ||
8 | "rev": "af958e8057f345ee1aca714c1247ef3ba1c15f5e", | ||
9 | "sha256": "1qjavxabbrsh73yck5dcq8jggvh3r2jkbr6b5nlz5d9yrqm9255n", | ||
10 | "type": "tarball", | ||
11 | "url": "https://github.com/nmattia/niv/archive/af958e8057f345ee1aca714c1247ef3ba1c15f5e.tar.gz", | ||
12 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
13 | }, | ||
14 | "nixpkgs": { | ||
15 | "branch": "nixpkgs-unstable", | ||
16 | "description": "Nix Packages collection", | ||
17 | "homepage": "", | ||
18 | "owner": "NixOS", | ||
19 | "repo": "nixpkgs", | ||
20 | "rev": "c0e881852006b132236cbf0301bd1939bb50867e", | ||
21 | "sha256": "0fy7z7yxk5n7yslsvx5cyc6h21qwi4bhxf3awhirniszlbvaazy2", | ||
22 | "type": "tarball", | ||
23 | "url": "https://github.com/NixOS/nixpkgs/archive/c0e881852006b132236cbf0301bd1939bb50867e.tar.gz", | ||
24 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
25 | }, | ||
26 | "poetry2nix": { | ||
27 | "branch": "master", | ||
28 | "description": "Convert poetry projects to nix automagically [maintainer=@adisbladis] ", | ||
29 | "homepage": "", | ||
30 | "owner": "nix-community", | ||
31 | "repo": "poetry2nix", | ||
32 | "rev": "2d27d44397242b28c3f0081e0432e4f6c951f3a1", | ||
33 | "sha256": "06syfg150r59m4kksj5547b5kwxjxjaif5hiljcq966kb9hxsvmv", | ||
34 | "type": "tarball", | ||
35 | "url": "https://github.com/nix-community/poetry2nix/archive/2d27d44397242b28c3f0081e0432e4f6c951f3a1.tar.gz", | ||
36 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
37 | } | ||
38 | } | ||
diff --git a/util/nix/sources.nix b/util/nix/sources.nix new file mode 100644 index 000000000..1938409dd --- /dev/null +++ b/util/nix/sources.nix | |||
@@ -0,0 +1,174 @@ | |||
1 | # This file has been generated by Niv. | ||
2 | |||
3 | let | ||
4 | |||
5 | # | ||
6 | # The fetchers. fetch_<type> fetches specs of type <type>. | ||
7 | # | ||
8 | |||
9 | fetch_file = pkgs: name: spec: | ||
10 | let | ||
11 | name' = sanitizeName name + "-src"; | ||
12 | in | ||
13 | if spec.builtin or true then | ||
14 | builtins_fetchurl { inherit (spec) url sha256; name = name'; } | ||
15 | else | ||
16 | pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; | ||
17 | |||
18 | fetch_tarball = pkgs: name: spec: | ||
19 | let | ||
20 | name' = sanitizeName name + "-src"; | ||
21 | in | ||
22 | if spec.builtin or true then | ||
23 | builtins_fetchTarball { name = name'; inherit (spec) url sha256; } | ||
24 | else | ||
25 | pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; | ||
26 | |||
27 | fetch_git = name: spec: | ||
28 | let | ||
29 | ref = | ||
30 | if spec ? ref then spec.ref else | ||
31 | if spec ? branch then "refs/heads/${spec.branch}" else | ||
32 | if spec ? tag then "refs/tags/${spec.tag}" else | ||
33 | abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; | ||
34 | in | ||
35 | builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; | ||
36 | |||
37 | fetch_local = spec: spec.path; | ||
38 | |||
39 | fetch_builtin-tarball = name: throw | ||
40 | ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. | ||
41 | $ niv modify ${name} -a type=tarball -a builtin=true''; | ||
42 | |||
43 | fetch_builtin-url = name: throw | ||
44 | ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. | ||
45 | $ niv modify ${name} -a type=file -a builtin=true''; | ||
46 | |||
47 | # | ||
48 | # Various helpers | ||
49 | # | ||
50 | |||
51 | # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 | ||
52 | sanitizeName = name: | ||
53 | ( | ||
54 | concatMapStrings (s: if builtins.isList s then "-" else s) | ||
55 | ( | ||
56 | builtins.split "[^[:alnum:]+._?=-]+" | ||
57 | ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) | ||
58 | ) | ||
59 | ); | ||
60 | |||
61 | # The set of packages used when specs are fetched using non-builtins. | ||
62 | mkPkgs = sources: system: | ||
63 | let | ||
64 | sourcesNixpkgs = | ||
65 | import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; | ||
66 | hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; | ||
67 | hasThisAsNixpkgsPath = <nixpkgs> == ./.; | ||
68 | in | ||
69 | if builtins.hasAttr "nixpkgs" sources | ||
70 | then sourcesNixpkgs | ||
71 | else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then | ||
72 | import <nixpkgs> {} | ||
73 | else | ||
74 | abort | ||
75 | '' | ||
76 | Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or | ||
77 | add a package called "nixpkgs" to your sources.json. | ||
78 | ''; | ||
79 | |||
80 | # The actual fetching function. | ||
81 | fetch = pkgs: name: spec: | ||
82 | |||
83 | if ! builtins.hasAttr "type" spec then | ||
84 | abort "ERROR: niv spec ${name} does not have a 'type' attribute" | ||
85 | else if spec.type == "file" then fetch_file pkgs name spec | ||
86 | else if spec.type == "tarball" then fetch_tarball pkgs name spec | ||
87 | else if spec.type == "git" then fetch_git name spec | ||
88 | else if spec.type == "local" then fetch_local spec | ||
89 | else if spec.type == "builtin-tarball" then fetch_builtin-tarball name | ||
90 | else if spec.type == "builtin-url" then fetch_builtin-url name | ||
91 | else | ||
92 | abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; | ||
93 | |||
94 | # If the environment variable NIV_OVERRIDE_${name} is set, then use | ||
95 | # the path directly as opposed to the fetched source. | ||
96 | replace = name: drv: | ||
97 | let | ||
98 | saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; | ||
99 | ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; | ||
100 | in | ||
101 | if ersatz == "" then drv else | ||
102 | # this turns the string into an actual Nix path (for both absolute and | ||
103 | # relative paths) | ||
104 | if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; | ||
105 | |||
106 | # Ports of functions for older nix versions | ||
107 | |||
108 | # a Nix version of mapAttrs if the built-in doesn't exist | ||
109 | mapAttrs = builtins.mapAttrs or ( | ||
110 | f: set: with builtins; | ||
111 | listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) | ||
112 | ); | ||
113 | |||
114 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 | ||
115 | range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); | ||
116 | |||
117 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 | ||
118 | stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); | ||
119 | |||
120 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 | ||
121 | stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); | ||
122 | concatMapStrings = f: list: concatStrings (map f list); | ||
123 | concatStrings = builtins.concatStringsSep ""; | ||
124 | |||
125 | # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 | ||
126 | optionalAttrs = cond: as: if cond then as else {}; | ||
127 | |||
128 | # fetchTarball version that is compatible between all the versions of Nix | ||
129 | builtins_fetchTarball = { url, name ? null, sha256 }@attrs: | ||
130 | let | ||
131 | inherit (builtins) lessThan nixVersion fetchTarball; | ||
132 | in | ||
133 | if lessThan nixVersion "1.12" then | ||
134 | fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) | ||
135 | else | ||
136 | fetchTarball attrs; | ||
137 | |||
138 | # fetchurl version that is compatible between all the versions of Nix | ||
139 | builtins_fetchurl = { url, name ? null, sha256 }@attrs: | ||
140 | let | ||
141 | inherit (builtins) lessThan nixVersion fetchurl; | ||
142 | in | ||
143 | if lessThan nixVersion "1.12" then | ||
144 | fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) | ||
145 | else | ||
146 | fetchurl attrs; | ||
147 | |||
148 | # Create the final "sources" from the config | ||
149 | mkSources = config: | ||
150 | mapAttrs ( | ||
151 | name: spec: | ||
152 | if builtins.hasAttr "outPath" spec | ||
153 | then abort | ||
154 | "The values in sources.json should not have an 'outPath' attribute" | ||
155 | else | ||
156 | spec // { outPath = replace name (fetch config.pkgs name spec); } | ||
157 | ) config.sources; | ||
158 | |||
159 | # The "config" used by the fetchers | ||
160 | mkConfig = | ||
161 | { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null | ||
162 | , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) | ||
163 | , system ? builtins.currentSystem | ||
164 | , pkgs ? mkPkgs sources system | ||
165 | }: rec { | ||
166 | # The sources, i.e. the attribute set of spec name to spec | ||
167 | inherit sources; | ||
168 | |||
169 | # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers | ||
170 | inherit pkgs; | ||
171 | }; | ||
172 | |||
173 | in | ||
174 | mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } | ||