diff options
author | Steve Purcell <steve@sanityinc.com> | 2021-04-04 03:05:46 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-03 08:05:46 -0700 |
commit | d91938c19dd65af88713b9deffe95794ed78e889 (patch) | |
tree | 9fdca00bdbb1a90ffc1245c173589bbaa3b780e5 | |
parent | a3cd1290be8187a34e3c4e156c07531380bfecaa (diff) | |
download | qmk_firmware-d91938c19dd65af88713b9deffe95794ed78e889.tar.gz qmk_firmware-d91938c19dd65af88713b9deffe95794ed78e889.zip |
[nix] Use niv and poetry2nix to more easily manage dependencies (#11181)
* [nix] Update nixpkgs to avoid issues with Big Sur
The older nixpkgs snapshot did not contain nix changes to the
compiler/linker hooks that are necessary for compatibility with MacOS
Big Sur. The fix is simply to update to a newer snapshot.
* [nix] Add a poetry manifest and use poetry to build the Python env
* [nix] Use niv to manage upstream sources like nixpkgs
* [nix] Update to newer nixpkgs snapshot
* [nix] Bump python package versions
-rw-r--r-- | .gitattributes | 1 | ||||
-rw-r--r-- | nix/poetry.lock | 369 | ||||
-rw-r--r-- | nix/pyproject.toml | 30 | ||||
-rw-r--r-- | nix/sources.json | 26 | ||||
-rw-r--r-- | nix/sources.nix | 174 | ||||
-rw-r--r-- | shell.nix | 35 |
6 files changed, 611 insertions, 24 deletions
diff --git a/.gitattributes b/.gitattributes index 92dfc3c61..a0fd4fed6 100644 --- a/.gitattributes +++ b/.gitattributes | |||
@@ -92,3 +92,4 @@ GRAPHICS | |||
92 | # hex files | 92 | # hex files |
93 | *.hex binary | 93 | *.hex binary |
94 | *.eep binary | 94 | *.eep binary |
95 | nix/sources.nix linguist-generated=true | ||
diff --git a/nix/poetry.lock b/nix/poetry.lock new file mode 100644 index 000000000..74d6e7dd5 --- /dev/null +++ b/nix/poetry.lock | |||
@@ -0,0 +1,369 @@ | |||
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.2" | ||
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 = "20.3.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.*" | ||
27 | |||
28 | [package.extras] | ||
29 | dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"] | ||
30 | docs = ["furo", "sphinx", "zope.interface"] | ||
31 | tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] | ||
32 | tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] | ||
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 = "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.0" | ||
67 | description = "the modular source code checker: pep8 pyflakes and co" | ||
68 | category = "dev" | ||
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 = "hjson" | ||
90 | version = "3.0.2" | ||
91 | description = "Hjson, a user interface for JSON." | ||
92 | category = "main" | ||
93 | optional = false | ||
94 | python-versions = "*" | ||
95 | |||
96 | [[package]] | ||
97 | name = "jsonschema" | ||
98 | version = "3.2.0" | ||
99 | description = "An implementation of JSON Schema validation for Python" | ||
100 | category = "main" | ||
101 | optional = false | ||
102 | python-versions = "*" | ||
103 | |||
104 | [package.dependencies] | ||
105 | attrs = ">=17.4.0" | ||
106 | pyrsistent = ">=0.14.0" | ||
107 | six = ">=1.11.0" | ||
108 | |||
109 | [package.extras] | ||
110 | format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] | ||
111 | format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"] | ||
112 | |||
113 | [[package]] | ||
114 | name = "mccabe" | ||
115 | version = "0.6.1" | ||
116 | description = "McCabe checker, plugin for flake8" | ||
117 | category = "dev" | ||
118 | optional = false | ||
119 | python-versions = "*" | ||
120 | |||
121 | [[package]] | ||
122 | name = "milc" | ||
123 | version = "1.3.0" | ||
124 | description = "Opinionated Batteries-Included Python 3 CLI Framework." | ||
125 | category = "main" | ||
126 | optional = false | ||
127 | python-versions = "*" | ||
128 | |||
129 | [package.dependencies] | ||
130 | appdirs = "*" | ||
131 | argcomplete = "*" | ||
132 | colorama = "*" | ||
133 | |||
134 | [[package]] | ||
135 | name = "nose2" | ||
136 | version = "0.10.0" | ||
137 | description = "unittest2 with plugins, the succesor to nose" | ||
138 | category = "dev" | ||
139 | optional = false | ||
140 | python-versions = "*" | ||
141 | |||
142 | [package.dependencies] | ||
143 | coverage = ">=4.4.1" | ||
144 | six = ">=1.7" | ||
145 | |||
146 | [package.extras] | ||
147 | coverage_plugin = ["coverage (>=4.4.1)"] | ||
148 | dev = ["Sphinx (>=1.6.5)", "sphinx-rtd-theme", "mock", "coverage"] | ||
149 | |||
150 | [[package]] | ||
151 | name = "pep8-naming" | ||
152 | version = "0.11.1" | ||
153 | description = "Check PEP-8 naming conventions, plugin for flake8" | ||
154 | category = "dev" | ||
155 | optional = false | ||
156 | python-versions = "*" | ||
157 | |||
158 | [package.dependencies] | ||
159 | flake8-polyfill = ">=1.0.2,<2" | ||
160 | |||
161 | [[package]] | ||
162 | name = "pycodestyle" | ||
163 | version = "2.7.0" | ||
164 | description = "Python style guide checker" | ||
165 | category = "dev" | ||
166 | optional = false | ||
167 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" | ||
168 | |||
169 | [[package]] | ||
170 | name = "pyflakes" | ||
171 | version = "2.3.1" | ||
172 | description = "passive checker of Python programs" | ||
173 | category = "dev" | ||
174 | optional = false | ||
175 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" | ||
176 | |||
177 | [[package]] | ||
178 | name = "pygments" | ||
179 | version = "2.8.1" | ||
180 | description = "Pygments is a syntax highlighting package written in Python." | ||
181 | category = "main" | ||
182 | optional = false | ||
183 | python-versions = ">=3.5" | ||
184 | |||
185 | [[package]] | ||
186 | name = "pyrsistent" | ||
187 | version = "0.17.3" | ||
188 | description = "Persistent/Functional/Immutable data structures" | ||
189 | category = "main" | ||
190 | optional = false | ||
191 | python-versions = ">=3.5" | ||
192 | |||
193 | [[package]] | ||
194 | name = "setuptools-scm" | ||
195 | version = "6.0.1" | ||
196 | description = "the blessed package to manage your versions by scm tags" | ||
197 | category = "main" | ||
198 | optional = false | ||
199 | python-versions = ">=3.6" | ||
200 | |||
201 | [package.extras] | ||
202 | toml = ["toml"] | ||
203 | |||
204 | [[package]] | ||
205 | name = "six" | ||
206 | version = "1.15.0" | ||
207 | description = "Python 2 and 3 compatibility utilities" | ||
208 | category = "main" | ||
209 | optional = false | ||
210 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" | ||
211 | |||
212 | [[package]] | ||
213 | name = "wave" | ||
214 | version = "0.0.2" | ||
215 | description = "Whole Architecture Verification" | ||
216 | category = "dev" | ||
217 | optional = false | ||
218 | python-versions = "*" | ||
219 | |||
220 | [[package]] | ||
221 | name = "yapf" | ||
222 | version = "0.30.0" | ||
223 | description = "A formatter for Python code." | ||
224 | category = "dev" | ||
225 | optional = false | ||
226 | python-versions = "*" | ||
227 | |||
228 | [metadata] | ||
229 | lock-version = "1.1" | ||
230 | python-versions = "^3.8" | ||
231 | content-hash = "6adb87c61d9eacf55e4e80bc6c73325e4e4854a792e3881ff448b6ee1cb75091" | ||
232 | |||
233 | [metadata.files] | ||
234 | appdirs = [ | ||
235 | {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, | ||
236 | {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, | ||
237 | ] | ||
238 | argcomplete = [ | ||
239 | {file = "argcomplete-1.12.2-py2.py3-none-any.whl", hash = "sha256:17f01a9b9b9ece3e6b07058eae737ad6e10de8b4e149105f84614783913aba71"}, | ||
240 | {file = "argcomplete-1.12.2.tar.gz", hash = "sha256:de0e1282330940d52ea92a80fea2e4b9e0da1932aaa570f84d268939d1897b04"}, | ||
241 | ] | ||
242 | attrs = [ | ||
243 | {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, | ||
244 | {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, | ||
245 | ] | ||
246 | colorama = [ | ||
247 | {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, | ||
248 | {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, | ||
249 | ] | ||
250 | coverage = [ | ||
251 | {file = "coverage-5.5-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf"}, | ||
252 | {file = "coverage-5.5-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b"}, | ||
253 | {file = "coverage-5.5-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669"}, | ||
254 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90"}, | ||
255 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c"}, | ||
256 | {file = "coverage-5.5-cp27-cp27m-win32.whl", hash = "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a"}, | ||
257 | {file = "coverage-5.5-cp27-cp27m-win_amd64.whl", hash = "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82"}, | ||
258 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905"}, | ||
259 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083"}, | ||
260 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5"}, | ||
261 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81"}, | ||
262 | {file = "coverage-5.5-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6"}, | ||
263 | {file = "coverage-5.5-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0"}, | ||
264 | {file = "coverage-5.5-cp310-cp310-win_amd64.whl", hash = "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae"}, | ||
265 | {file = "coverage-5.5-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb"}, | ||
266 | {file = "coverage-5.5-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160"}, | ||
267 | {file = "coverage-5.5-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6"}, | ||
268 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701"}, | ||
269 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793"}, | ||
270 | {file = "coverage-5.5-cp35-cp35m-win32.whl", hash = "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e"}, | ||
271 | {file = "coverage-5.5-cp35-cp35m-win_amd64.whl", hash = "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3"}, | ||
272 | {file = "coverage-5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066"}, | ||
273 | {file = "coverage-5.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a"}, | ||
274 | {file = "coverage-5.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465"}, | ||
275 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb"}, | ||
276 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821"}, | ||
277 | {file = "coverage-5.5-cp36-cp36m-win32.whl", hash = "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45"}, | ||
278 | {file = "coverage-5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184"}, | ||
279 | {file = "coverage-5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a"}, | ||
280 | {file = "coverage-5.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53"}, | ||
281 | {file = "coverage-5.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d"}, | ||
282 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638"}, | ||
283 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3"}, | ||
284 | {file = "coverage-5.5-cp37-cp37m-win32.whl", hash = "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a"}, | ||
285 | {file = "coverage-5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a"}, | ||
286 | {file = "coverage-5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6"}, | ||
287 | {file = "coverage-5.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2"}, | ||
288 | {file = "coverage-5.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759"}, | ||
289 | {file = "coverage-5.5-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873"}, | ||
290 | {file = "coverage-5.5-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a"}, | ||
291 | {file = "coverage-5.5-cp38-cp38-win32.whl", hash = "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6"}, | ||
292 | {file = "coverage-5.5-cp38-cp38-win_amd64.whl", hash = "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502"}, | ||
293 | {file = "coverage-5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b"}, | ||
294 | {file = "coverage-5.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529"}, | ||
295 | {file = "coverage-5.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b"}, | ||
296 | {file = "coverage-5.5-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff"}, | ||
297 | {file = "coverage-5.5-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b"}, | ||
298 | {file = "coverage-5.5-cp39-cp39-win32.whl", hash = "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6"}, | ||
299 | {file = "coverage-5.5-cp39-cp39-win_amd64.whl", hash = "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03"}, | ||
300 | {file = "coverage-5.5-pp36-none-any.whl", hash = "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079"}, | ||
301 | {file = "coverage-5.5-pp37-none-any.whl", hash = "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4"}, | ||
302 | {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}, | ||
303 | ] | ||
304 | dotty-dict = [ | ||
305 | {file = "dotty_dict-1.3.0.tar.gz", hash = "sha256:eb0035a3629ecd84397a68f1f42f1e94abd1c34577a19cd3eacad331ee7cbaf0"}, | ||
306 | ] | ||
307 | flake8 = [ | ||
308 | {file = "flake8-3.9.0-py2.py3-none-any.whl", hash = "sha256:12d05ab02614b6aee8df7c36b97d1a3b2372761222b19b58621355e82acddcff"}, | ||
309 | {file = "flake8-3.9.0.tar.gz", hash = "sha256:78873e372b12b093da7b5e5ed302e8ad9e988b38b063b61ad937f26ca58fc5f0"}, | ||
310 | ] | ||
311 | flake8-polyfill = [ | ||
312 | {file = "flake8-polyfill-1.0.2.tar.gz", hash = "sha256:e44b087597f6da52ec6393a709e7108b2905317d0c0b744cdca6208e670d8eda"}, | ||
313 | {file = "flake8_polyfill-1.0.2-py2.py3-none-any.whl", hash = "sha256:12be6a34ee3ab795b19ca73505e7b55826d5f6ad7230d31b18e106400169b9e9"}, | ||
314 | ] | ||
315 | hjson = [ | ||
316 | {file = "hjson-3.0.2-py3-none-any.whl", hash = "sha256:5546438bf4e1b52bc964c6a47c4ed10fa5fba8a1b264e22efa893e333baad2db"}, | ||
317 | {file = "hjson-3.0.2.tar.gz", hash = "sha256:2838fd7200e5839ea4516ece953f3a19892c41089f0d933ba3f68e596aacfcd5"}, | ||
318 | ] | ||
319 | jsonschema = [ | ||
320 | {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, | ||
321 | {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, | ||
322 | ] | ||
323 | mccabe = [ | ||
324 | {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, | ||
325 | {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, | ||
326 | ] | ||
327 | milc = [ | ||
328 | {file = "milc-1.3.0-py2.py3-none-any.whl", hash = "sha256:a4dd8ce77f1d4ac5e08311eecc6954c349d4032d7ed4e0335822e09740514f22"}, | ||
329 | {file = "milc-1.3.0.tar.gz", hash = "sha256:a9d0299aaaef7a3f00010589c3c0d0669798467e397580620a68e9290b36cdda"}, | ||
330 | ] | ||
331 | nose2 = [ | ||
332 | {file = "nose2-0.10.0-py2.py3-none-any.whl", hash = "sha256:aa620e759f2c5018d9ba041340391913e282ecebd3c392027f1575847b093ec6"}, | ||
333 | {file = "nose2-0.10.0.tar.gz", hash = "sha256:886ba617a96de0130c54b24479bd5c2d74d5c940d40f3809c3a275511a0c4a60"}, | ||
334 | ] | ||
335 | pep8-naming = [ | ||
336 | {file = "pep8-naming-0.11.1.tar.gz", hash = "sha256:a1dd47dd243adfe8a83616e27cf03164960b507530f155db94e10b36a6cd6724"}, | ||
337 | {file = "pep8_naming-0.11.1-py2.py3-none-any.whl", hash = "sha256:f43bfe3eea7e0d73e8b5d07d6407ab47f2476ccaeff6937c84275cd30b016738"}, | ||
338 | ] | ||
339 | pycodestyle = [ | ||
340 | {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, | ||
341 | {file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"}, | ||
342 | ] | ||
343 | pyflakes = [ | ||
344 | {file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"}, | ||
345 | {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, | ||
346 | ] | ||
347 | pygments = [ | ||
348 | {file = "Pygments-2.8.1-py3-none-any.whl", hash = "sha256:534ef71d539ae97d4c3a4cf7d6f110f214b0e687e92f9cb9d2a3b0d3101289c8"}, | ||
349 | {file = "Pygments-2.8.1.tar.gz", hash = "sha256:2656e1a6edcdabf4275f9a3640db59fd5de107d88e8663c5d4e9a0fa62f77f94"}, | ||
350 | ] | ||
351 | pyrsistent = [ | ||
352 | {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"}, | ||
353 | ] | ||
354 | setuptools-scm = [ | ||
355 | {file = "setuptools_scm-6.0.1-py3-none-any.whl", hash = "sha256:c3bd5f701c8def44a5c0bfe8d407bef3f80342217ef3492b951f3777bd2d915c"}, | ||
356 | {file = "setuptools_scm-6.0.1.tar.gz", hash = "sha256:d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92"}, | ||
357 | ] | ||
358 | six = [ | ||
359 | {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, | ||
360 | {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, | ||
361 | ] | ||
362 | wave = [ | ||
363 | {file = "Wave-0.0.2.tar.gz", hash = "sha256:5a895bb85e04e38c82dba90d66a5ae8f488b50c58f3fc4df868a5bcdcabb8632"}, | ||
364 | {file = "Wave-0.0.2.zip", hash = "sha256:5187f49497287d218cc83d4cd1e5299dc31485ab3ed32abbaa9e95d8f73c4095"}, | ||
365 | ] | ||
366 | yapf = [ | ||
367 | {file = "yapf-0.30.0-py2.py3-none-any.whl", hash = "sha256:3abf61ba67cf603069710d30acbc88cfe565d907e16ad81429ae90ce9651e0c9"}, | ||
368 | {file = "yapf-0.30.0.tar.gz", hash = "sha256:3000abee4c28daebad55da6c85f3cd07b8062ce48e2e9943c8da1b9667d48427"}, | ||
369 | ] | ||
diff --git a/nix/pyproject.toml b/nix/pyproject.toml new file mode 100644 index 000000000..62d49fad5 --- /dev/null +++ b/nix/pyproject.toml | |||
@@ -0,0 +1,30 @@ | |||
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" | ||
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 | hjson = "^3.0.2" | ||
16 | milc = "^1.1.0" | ||
17 | Pygments = "^2.8.0" | ||
18 | dotty-dict = "^1.3.0" | ||
19 | jsonschema = "^3.2.0" | ||
20 | |||
21 | [tool.poetry.dev-dependencies] | ||
22 | nose2 = "^0.10.0" | ||
23 | flake8 = "^3.8.4" | ||
24 | pep8-naming = "^0.11.1" | ||
25 | yapf = "^0.30.0" | ||
26 | Wave = "^0.0.2" | ||
27 | |||
28 | [build-system] | ||
29 | requires = ["poetry-core>=1.0.0"] | ||
30 | build-backend = "poetry.core.masonry.api" | ||
diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 000000000..7afca3707 --- /dev/null +++ b/nix/sources.json | |||
@@ -0,0 +1,26 @@ | |||
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 | } | ||
diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 000000000..1938409dd --- /dev/null +++ b/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); } | ||
@@ -1,29 +1,16 @@ | |||
1 | { avr ? true, arm ? true, teensy ? true }: | 1 | { avr ? true, arm ? true, teensy ? true }: |
2 | |||
3 | let | 2 | let |
4 | nixpkgs = builtins.fetchTarball { | 3 | # We specify sources via Niv: use "niv update nixpkgs" to update nixpkgs, for example. |
5 | url = "https://github.com/NixOS/nixpkgs/archive/1f77a4c8c74bbe896053994836790aa9bf6dc5ba.tar.gz"; | 4 | sources = import ./nix/sources.nix {}; |
6 | sha256 = "1j62nmzz3w33dplzf1xz1pg1pfkxii7lwdqmsxmc71cs9cm3s7n1"; | 5 | pkgs = import sources.nixpkgs {}; |
7 | }; | ||
8 | 6 | ||
9 | pkgs = import nixpkgs { }; | 7 | # Builds the python env based on nix/pyproject.toml and |
10 | 8 | # nix/poetry.lock Use the "poetry update --lock", "poetry add | |
11 | pythonEnv = pkgs.python3.withPackages (p: with p; [ | 9 | # --lock" etc. in the nix folder to adjust the contents of those |
12 | # requirements.txt | 10 | # files if the requirements*.txt files change |
13 | appdirs | 11 | pythonEnv = pkgs.poetry2nix.mkPoetryEnv { |
14 | argcomplete | 12 | projectDir = ./nix; |
15 | colorama | 13 | }; |
16 | dotty-dict | ||
17 | hjson | ||
18 | jsonschema | ||
19 | milc | ||
20 | pygments | ||
21 | # requirements-dev.txt | ||
22 | nose2 | ||
23 | flake8 | ||
24 | pep8-naming | ||
25 | yapf | ||
26 | ]); | ||
27 | in | 14 | in |
28 | 15 | ||
29 | with pkgs; | 16 | with pkgs; |
@@ -43,7 +30,7 @@ in | |||
43 | mkShell { | 30 | mkShell { |
44 | name = "qmk-firmware"; | 31 | name = "qmk-firmware"; |
45 | 32 | ||
46 | buildInputs = [ clang-tools dfu-programmer dfu-util diffutils git pythonEnv ] | 33 | buildInputs = [ clang-tools dfu-programmer dfu-util diffutils git pythonEnv poetry niv ] |
47 | ++ lib.optional avr [ | 34 | ++ lib.optional avr [ |
48 | pkgsCross.avr.buildPackages.binutils | 35 | pkgsCross.avr.buildPackages.binutils |
49 | pkgsCross.avr.buildPackages.gcc8 | 36 | pkgsCross.avr.buildPackages.gcc8 |