diff options
author | Joel Challis <git@zvecr.com> | 2021-08-25 15:27:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 15:27:48 +0100 |
commit | 527b1e52aa0c87d49b90ea18d7d3ca9728aaa9c2 (patch) | |
tree | 24666f21008a6d27a2b9ae10e40f9283d16ebd8a /util | |
parent | a84de5e22be25e2059dfee732f5cca3ec0953a35 (diff) | |
download | qmk_firmware-527b1e52aa0c87d49b90ea18d7d3ca9728aaa9c2.tar.gz qmk_firmware-527b1e52aa0c87d49b90ea18d7d3ca9728aaa9c2.zip |
Move nix folder alongside vagrant (#14132)
Diffstat (limited to 'util')
-rw-r--r-- | util/nix/poetry.lock | 467 | ||||
-rw-r--r-- | util/nix/pyproject.toml | 32 | ||||
-rw-r--r-- | util/nix/sources.json | 38 | ||||
-rw-r--r-- | util/nix/sources.nix | 174 |
4 files changed, 711 insertions, 0 deletions
diff --git a/util/nix/poetry.lock b/util/nix/poetry.lock new file mode 100644 index 000000000..1a1aefe21 --- /dev/null +++ b/util/nix/poetry.lock | |||
@@ -0,0 +1,467 @@ | |||
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 = "main" | ||
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 = "dotty-dict" | ||
55 | version = "1.3.0" | ||
56 | description = "Dictionary wrapper for quick access to deeply nested keys." | ||
57 | category = "main" | ||
58 | optional = false | ||
59 | python-versions = "*" | ||
60 | |||
61 | [package.dependencies] | ||
62 | setuptools_scm = "*" | ||
63 | |||
64 | [[package]] | ||
65 | name = "flake8" | ||
66 | version = "3.9.2" | ||
67 | description = "the modular source code checker: pep8 pyflakes and co" | ||
68 | category = "main" | ||
69 | optional = false | ||
70 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" | ||
71 | |||
72 | [package.dependencies] | ||
73 | mccabe = ">=0.6.0,<0.7.0" | ||
74 | pycodestyle = ">=2.7.0,<2.8.0" | ||
75 | pyflakes = ">=2.3.0,<2.4.0" | ||
76 | |||
77 | [[package]] | ||
78 | name = "flake8-polyfill" | ||
79 | version = "1.0.2" | ||
80 | description = "Polyfill package for Flake8 plugins" | ||
81 | category = "dev" | ||
82 | optional = false | ||
83 | python-versions = "*" | ||
84 | |||
85 | [package.dependencies] | ||
86 | flake8 = "*" | ||
87 | |||
88 | [[package]] | ||
89 | name = "halo" | ||
90 | version = "0.0.31" | ||
91 | description = "Beautiful terminal spinners in Python" | ||
92 | category = "main" | ||
93 | optional = false | ||
94 | python-versions = ">=3.4" | ||
95 | |||
96 | [package.dependencies] | ||
97 | colorama = ">=0.3.9" | ||
98 | log-symbols = ">=0.0.14" | ||
99 | six = ">=1.12.0" | ||
100 | spinners = ">=0.0.24" | ||
101 | termcolor = ">=1.1.0" | ||
102 | |||
103 | [package.extras] | ||
104 | ipython = ["IPython (==5.7.0)", "ipywidgets (==7.1.0)"] | ||
105 | |||
106 | [[package]] | ||
107 | name = "hid" | ||
108 | version = "1.0.4" | ||
109 | description = "ctypes bindings for hidapi" | ||
110 | category = "main" | ||
111 | optional = false | ||
112 | python-versions = "*" | ||
113 | |||
114 | [[package]] | ||
115 | name = "hjson" | ||
116 | version = "3.0.2" | ||
117 | description = "Hjson, a user interface for JSON." | ||
118 | category = "main" | ||
119 | optional = false | ||
120 | python-versions = "*" | ||
121 | |||
122 | [[package]] | ||
123 | name = "jsonschema" | ||
124 | version = "3.2.0" | ||
125 | description = "An implementation of JSON Schema validation for Python" | ||
126 | category = "main" | ||
127 | optional = false | ||
128 | python-versions = "*" | ||
129 | |||
130 | [package.dependencies] | ||
131 | attrs = ">=17.4.0" | ||
132 | pyrsistent = ">=0.14.0" | ||
133 | six = ">=1.11.0" | ||
134 | |||
135 | [package.extras] | ||
136 | format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] | ||
137 | format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"] | ||
138 | |||
139 | [[package]] | ||
140 | name = "log-symbols" | ||
141 | version = "0.0.14" | ||
142 | description = "Colored symbols for various log levels for Python" | ||
143 | category = "main" | ||
144 | optional = false | ||
145 | python-versions = "*" | ||
146 | |||
147 | [package.dependencies] | ||
148 | colorama = ">=0.3.9" | ||
149 | |||
150 | [[package]] | ||
151 | name = "mccabe" | ||
152 | version = "0.6.1" | ||
153 | description = "McCabe checker, plugin for flake8" | ||
154 | category = "main" | ||
155 | optional = false | ||
156 | python-versions = "*" | ||
157 | |||
158 | [[package]] | ||
159 | name = "milc" | ||
160 | version = "1.4.2" | ||
161 | description = "Opinionated Batteries-Included Python 3 CLI Framework." | ||
162 | category = "main" | ||
163 | optional = false | ||
164 | python-versions = "*" | ||
165 | |||
166 | [package.dependencies] | ||
167 | appdirs = "*" | ||
168 | argcomplete = "*" | ||
169 | colorama = "*" | ||
170 | halo = "*" | ||
171 | spinners = "*" | ||
172 | |||
173 | [[package]] | ||
174 | name = "nose2" | ||
175 | version = "0.10.0" | ||
176 | description = "unittest2 with plugins, the succesor to nose" | ||
177 | category = "main" | ||
178 | optional = false | ||
179 | python-versions = "*" | ||
180 | |||
181 | [package.dependencies] | ||
182 | coverage = ">=4.4.1" | ||
183 | six = ">=1.7" | ||
184 | |||
185 | [package.extras] | ||
186 | coverage_plugin = ["coverage (>=4.4.1)"] | ||
187 | dev = ["Sphinx (>=1.6.5)", "sphinx-rtd-theme", "mock", "coverage"] | ||
188 | |||
189 | [[package]] | ||
190 | name = "pep8-naming" | ||
191 | version = "0.11.1" | ||
192 | description = "Check PEP-8 naming conventions, plugin for flake8" | ||
193 | category = "dev" | ||
194 | optional = false | ||
195 | python-versions = "*" | ||
196 | |||
197 | [package.dependencies] | ||
198 | flake8-polyfill = ">=1.0.2,<2" | ||
199 | |||
200 | [[package]] | ||
201 | name = "pycodestyle" | ||
202 | version = "2.7.0" | ||
203 | description = "Python style guide checker" | ||
204 | category = "main" | ||
205 | optional = false | ||
206 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" | ||
207 | |||
208 | [[package]] | ||
209 | name = "pyflakes" | ||
210 | version = "2.3.1" | ||
211 | description = "passive checker of Python programs" | ||
212 | category = "main" | ||
213 | optional = false | ||
214 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" | ||
215 | |||
216 | [[package]] | ||
217 | name = "pygments" | ||
218 | version = "2.9.0" | ||
219 | description = "Pygments is a syntax highlighting package written in Python." | ||
220 | category = "main" | ||
221 | optional = false | ||
222 | python-versions = ">=3.5" | ||
223 | |||
224 | [[package]] | ||
225 | name = "pyrsistent" | ||
226 | version = "0.17.3" | ||
227 | description = "Persistent/Functional/Immutable data structures" | ||
228 | category = "main" | ||
229 | optional = false | ||
230 | python-versions = ">=3.5" | ||
231 | |||
232 | [[package]] | ||
233 | name = "pyusb" | ||
234 | version = "1.1.1" | ||
235 | description = "Python USB access module" | ||
236 | category = "main" | ||
237 | optional = false | ||
238 | python-versions = "*" | ||
239 | |||
240 | [[package]] | ||
241 | name = "qmk" | ||
242 | version = "0.0.51" | ||
243 | description = "A program to help users work with QMK Firmware." | ||
244 | category = "main" | ||
245 | optional = false | ||
246 | python-versions = ">=3.7" | ||
247 | |||
248 | [package.dependencies] | ||
249 | dotty-dict = "*" | ||
250 | flake8 = "*" | ||
251 | hid = "*" | ||
252 | hjson = "*" | ||
253 | jsonschema = ">=3" | ||
254 | milc = ">=1.4.0" | ||
255 | nose2 = "*" | ||
256 | pygments = "*" | ||
257 | pyusb = "*" | ||
258 | yapf = "*" | ||
259 | |||
260 | [[package]] | ||
261 | name = "setuptools-scm" | ||
262 | version = "6.0.1" | ||
263 | description = "the blessed package to manage your versions by scm tags" | ||
264 | category = "main" | ||
265 | optional = false | ||
266 | python-versions = ">=3.6" | ||
267 | |||
268 | [package.extras] | ||
269 | toml = ["toml"] | ||
270 | |||
271 | [[package]] | ||
272 | name = "six" | ||
273 | version = "1.16.0" | ||
274 | description = "Python 2 and 3 compatibility utilities" | ||
275 | category = "main" | ||
276 | optional = false | ||
277 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" | ||
278 | |||
279 | [[package]] | ||
280 | name = "spinners" | ||
281 | version = "0.0.24" | ||
282 | description = "Spinners for terminals" | ||
283 | category = "main" | ||
284 | optional = false | ||
285 | python-versions = "*" | ||
286 | |||
287 | [[package]] | ||
288 | name = "termcolor" | ||
289 | version = "1.1.0" | ||
290 | description = "ANSII Color formatting for output in terminal." | ||
291 | category = "main" | ||
292 | optional = false | ||
293 | python-versions = "*" | ||
294 | |||
295 | [[package]] | ||
296 | name = "yapf" | ||
297 | version = "0.30.0" | ||
298 | description = "A formatter for Python code." | ||
299 | category = "main" | ||
300 | optional = false | ||
301 | python-versions = "*" | ||
302 | |||
303 | [metadata] | ||
304 | lock-version = "1.1" | ||
305 | python-versions = "^3.8" | ||
306 | content-hash = "5e181d51536240d08c74ba6a46bd0988ee4ca72ac3d5b388965ca8023e9b9a99" | ||
307 | |||
308 | [metadata.files] | ||
309 | appdirs = [ | ||
310 | {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, | ||
311 | {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, | ||
312 | ] | ||
313 | argcomplete = [ | ||
314 | {file = "argcomplete-1.12.3-py2.py3-none-any.whl", hash = "sha256:291f0beca7fd49ce285d2f10e4c1c77e9460cf823eef2de54df0c0fec88b0d81"}, | ||
315 | {file = "argcomplete-1.12.3.tar.gz", hash = "sha256:2c7dbffd8c045ea534921e63b0be6fe65e88599990d8dc408ac8c542b72a5445"}, | ||
316 | ] | ||
317 | attrs = [ | ||
318 | {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, | ||
319 | {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, | ||
320 | ] | ||
321 | colorama = [ | ||
322 | {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, | ||
323 | {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, | ||
324 | ] | ||
325 | coverage = [ | ||
326 | {file = "coverage-5.5-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf"}, | ||
327 | {file = "coverage-5.5-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b"}, | ||
328 | {file = "coverage-5.5-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669"}, | ||
329 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90"}, | ||
330 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c"}, | ||
331 | {file = "coverage-5.5-cp27-cp27m-win32.whl", hash = "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a"}, | ||
332 | {file = "coverage-5.5-cp27-cp27m-win_amd64.whl", hash = "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82"}, | ||
333 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905"}, | ||
334 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083"}, | ||
335 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5"}, | ||
336 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81"}, | ||
337 | {file = "coverage-5.5-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6"}, | ||
338 | {file = "coverage-5.5-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0"}, | ||
339 | {file = "coverage-5.5-cp310-cp310-win_amd64.whl", hash = "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae"}, | ||
340 | {file = "coverage-5.5-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb"}, | ||
341 | {file = "coverage-5.5-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160"}, | ||
342 | {file = "coverage-5.5-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6"}, | ||
343 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701"}, | ||
344 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793"}, | ||
345 | {file = "coverage-5.5-cp35-cp35m-win32.whl", hash = "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e"}, | ||
346 | {file = "coverage-5.5-cp35-cp35m-win_amd64.whl", hash = "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3"}, | ||
347 | {file = "coverage-5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066"}, | ||
348 | {file = "coverage-5.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a"}, | ||
349 | {file = "coverage-5.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465"}, | ||
350 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb"}, | ||
351 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821"}, | ||
352 | {file = "coverage-5.5-cp36-cp36m-win32.whl", hash = "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45"}, | ||
353 | {file = "coverage-5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184"}, | ||
354 | {file = "coverage-5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a"}, | ||
355 | {file = "coverage-5.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53"}, | ||
356 | {file = "coverage-5.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d"}, | ||
357 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638"}, | ||
358 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3"}, | ||
359 | {file = "coverage-5.5-cp37-cp37m-win32.whl", hash = "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a"}, | ||
360 | {file = "coverage-5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a"}, | ||
361 | {file = "coverage-5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6"}, | ||
362 | {file = "coverage-5.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2"}, | ||
363 | {file = "coverage-5.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759"}, | ||
364 | {file = "coverage-5.5-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873"}, | ||
365 | {file = "coverage-5.5-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a"}, | ||
366 | {file = "coverage-5.5-cp38-cp38-win32.whl", hash = "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6"}, | ||
367 | {file = "coverage-5.5-cp38-cp38-win_amd64.whl", hash = "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502"}, | ||
368 | {file = "coverage-5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b"}, | ||
369 | {file = "coverage-5.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529"}, | ||
370 | {file = "coverage-5.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b"}, | ||
371 | {file = "coverage-5.5-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff"}, | ||
372 | {file = "coverage-5.5-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b"}, | ||
373 | {file = "coverage-5.5-cp39-cp39-win32.whl", hash = "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6"}, | ||
374 | {file = "coverage-5.5-cp39-cp39-win_amd64.whl", hash = "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03"}, | ||
375 | {file = "coverage-5.5-pp36-none-any.whl", hash = "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079"}, | ||
376 | {file = "coverage-5.5-pp37-none-any.whl", hash = "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4"}, | ||
377 | {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}, | ||
378 | ] | ||
379 | dotty-dict = [ | ||
380 | {file = "dotty_dict-1.3.0.tar.gz", hash = "sha256:eb0035a3629ecd84397a68f1f42f1e94abd1c34577a19cd3eacad331ee7cbaf0"}, | ||
381 | ] | ||
382 | flake8 = [ | ||
383 | {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, | ||
384 | {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, | ||
385 | ] | ||
386 | flake8-polyfill = [ | ||
387 | {file = "flake8-polyfill-1.0.2.tar.gz", hash = "sha256:e44b087597f6da52ec6393a709e7108b2905317d0c0b744cdca6208e670d8eda"}, | ||
388 | {file = "flake8_polyfill-1.0.2-py2.py3-none-any.whl", hash = "sha256:12be6a34ee3ab795b19ca73505e7b55826d5f6ad7230d31b18e106400169b9e9"}, | ||
389 | ] | ||
390 | halo = [ | ||
391 | {file = "halo-0.0.31-py2-none-any.whl", hash = "sha256:5350488fb7d2aa7c31a1344120cee67a872901ce8858f60da7946cef96c208ab"}, | ||
392 | {file = "halo-0.0.31.tar.gz", hash = "sha256:7b67a3521ee91d53b7152d4ee3452811e1d2a6321975137762eb3d70063cc9d6"}, | ||
393 | ] | ||
394 | hid = [ | ||
395 | {file = "hid-1.0.4-py2-none-any.whl", hash = "sha256:fba9913f07030b01059b822b24c83b370ca3f444e9e6443bd662f9f1aa3f0780"}, | ||
396 | {file = "hid-1.0.4.tar.gz", hash = "sha256:f61b0382f37a334bc8ba8604bc84b94875ee4f594fbbaf82b2c3b3e827883fc1"}, | ||
397 | ] | ||
398 | hjson = [ | ||
399 | {file = "hjson-3.0.2-py3-none-any.whl", hash = "sha256:5546438bf4e1b52bc964c6a47c4ed10fa5fba8a1b264e22efa893e333baad2db"}, | ||
400 | {file = "hjson-3.0.2.tar.gz", hash = "sha256:2838fd7200e5839ea4516ece953f3a19892c41089f0d933ba3f68e596aacfcd5"}, | ||
401 | ] | ||
402 | jsonschema = [ | ||
403 | {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, | ||
404 | {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, | ||
405 | ] | ||
406 | log-symbols = [ | ||
407 | {file = "log_symbols-0.0.14-py3-none-any.whl", hash = "sha256:4952106ff8b605ab7d5081dd2c7e6ca7374584eff7086f499c06edd1ce56dcca"}, | ||
408 | {file = "log_symbols-0.0.14.tar.gz", hash = "sha256:cf0bbc6fe1a8e53f0d174a716bc625c4f87043cc21eb55dd8a740cfe22680556"}, | ||
409 | ] | ||
410 | mccabe = [ | ||
411 | {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, | ||
412 | {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, | ||
413 | ] | ||
414 | milc = [ | ||
415 | {file = "milc-1.4.2-py2.py3-none-any.whl", hash = "sha256:65ee004caa769b1ee144b15be7908d1f623920ab6f356e5c5c95be9457aa15d8"}, | ||
416 | {file = "milc-1.4.2.tar.gz", hash = "sha256:c6b2f19e3196b00a0060f8c883533e356f2054a9f81692b7b97ccee0d01626fd"}, | ||
417 | ] | ||
418 | nose2 = [ | ||
419 | {file = "nose2-0.10.0-py2.py3-none-any.whl", hash = "sha256:aa620e759f2c5018d9ba041340391913e282ecebd3c392027f1575847b093ec6"}, | ||
420 | {file = "nose2-0.10.0.tar.gz", hash = "sha256:886ba617a96de0130c54b24479bd5c2d74d5c940d40f3809c3a275511a0c4a60"}, | ||
421 | ] | ||
422 | pep8-naming = [ | ||
423 | {file = "pep8-naming-0.11.1.tar.gz", hash = "sha256:a1dd47dd243adfe8a83616e27cf03164960b507530f155db94e10b36a6cd6724"}, | ||
424 | {file = "pep8_naming-0.11.1-py2.py3-none-any.whl", hash = "sha256:f43bfe3eea7e0d73e8b5d07d6407ab47f2476ccaeff6937c84275cd30b016738"}, | ||
425 | ] | ||
426 | pycodestyle = [ | ||
427 | {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, | ||
428 | {file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"}, | ||
429 | ] | ||
430 | pyflakes = [ | ||
431 | {file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"}, | ||
432 | {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, | ||
433 | ] | ||
434 | pygments = [ | ||
435 | {file = "Pygments-2.9.0-py3-none-any.whl", hash = "sha256:d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"}, | ||
436 | {file = "Pygments-2.9.0.tar.gz", hash = "sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"}, | ||
437 | ] | ||
438 | pyrsistent = [ | ||
439 | {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"}, | ||
440 | ] | ||
441 | pyusb = [ | ||
442 | {file = "pyusb-1.1.1-py3-none-any.whl", hash = "sha256:f18eb813d3a1439918071234589162c2f209a19adbeffeb1377ce078a4aebc70"}, | ||
443 | {file = "pyusb-1.1.1.tar.gz", hash = "sha256:7d449ad916ce58aff60b89aae0b65ac130f289c24d6a5b7b317742eccffafc38"}, | ||
444 | ] | ||
445 | qmk = [ | ||
446 | {file = "qmk-0.0.51-py2.py3-none-any.whl", hash = "sha256:5f676f389b2450b0956d7eb8e7e378d2e6690d5859a887c91876da0a5faf75ed"}, | ||
447 | {file = "qmk-0.0.51.tar.gz", hash = "sha256:efeef209cde1df92b9823db686d9684962cd00aae9f45ba5e3d494aa5b3c6b9a"}, | ||
448 | ] | ||
449 | setuptools-scm = [ | ||
450 | {file = "setuptools_scm-6.0.1-py3-none-any.whl", hash = "sha256:c3bd5f701c8def44a5c0bfe8d407bef3f80342217ef3492b951f3777bd2d915c"}, | ||
451 | {file = "setuptools_scm-6.0.1.tar.gz", hash = "sha256:d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92"}, | ||
452 | ] | ||
453 | six = [ | ||
454 | {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, | ||
455 | {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, | ||
456 | ] | ||
457 | spinners = [ | ||
458 | {file = "spinners-0.0.24-py3-none-any.whl", hash = "sha256:2fa30d0b72c9650ad12bbe031c9943b8d441e41b4f5602b0ec977a19f3290e98"}, | ||
459 | {file = "spinners-0.0.24.tar.gz", hash = "sha256:1eb6aeb4781d72ab42ed8a01dcf20f3002bf50740d7154d12fb8c9769bf9e27f"}, | ||
460 | ] | ||
461 | termcolor = [ | ||
462 | {file = "termcolor-1.1.0.tar.gz", hash = "sha256:1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b"}, | ||
463 | ] | ||
464 | yapf = [ | ||
465 | {file = "yapf-0.30.0-py2.py3-none-any.whl", hash = "sha256:3abf61ba67cf603069710d30acbc88cfe565d907e16ad81429ae90ce9651e0c9"}, | ||
466 | {file = "yapf-0.30.0.tar.gz", hash = "sha256:3000abee4c28daebad55da6c85f3cd07b8062ce48e2e9943c8da1b9667d48427"}, | ||
467 | ] | ||
diff --git a/util/nix/pyproject.toml b/util/nix/pyproject.toml new file mode 100644 index 000000000..a81336189 --- /dev/null +++ b/util/nix/pyproject.toml | |||
@@ -0,0 +1,32 @@ | |||
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 = "^1.4.4" | ||
13 | argcomplete = "^1.12.2" | ||
14 | colorama = "^0.4.4" | ||
15 | dotty-dict = "^1.3.0" | ||
16 | hjson = "^3.0.2" | ||
17 | jsonschema = "^3.2.0" | ||
18 | milc = "^1.3.0" | ||
19 | Pygments = "^2.8.0" | ||
20 | qmk = "*" | ||
21 | |||
22 | [tool.poetry.dev-dependencies] | ||
23 | nose2 = "^0.10.0" | ||
24 | flake8 = "^3.8.4" | ||
25 | hid = "^1.0.4" | ||
26 | pep8-naming = "^0.11.1" | ||
27 | pyusb = "^1.1.1" | ||
28 | yapf = "^0.30.0" | ||
29 | |||
30 | [build-system] | ||
31 | requires = ["poetry-core>=1.0.0"] | ||
32 | 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); } | ||