aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Purcell <steve@sanityinc.com>2021-04-04 03:05:46 +1200
committerGitHub <noreply@github.com>2021-04-03 08:05:46 -0700
commitd91938c19dd65af88713b9deffe95794ed78e889 (patch)
tree9fdca00bdbb1a90ffc1245c173589bbaa3b780e5
parenta3cd1290be8187a34e3c4e156c07531380bfecaa (diff)
downloadqmk_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--.gitattributes1
-rw-r--r--nix/poetry.lock369
-rw-r--r--nix/pyproject.toml30
-rw-r--r--nix/sources.json26
-rw-r--r--nix/sources.nix174
-rw-r--r--shell.nix35
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
95nix/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]]
2name = "appdirs"
3version = "1.4.4"
4description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
5category = "main"
6optional = false
7python-versions = "*"
8
9[[package]]
10name = "argcomplete"
11version = "1.12.2"
12description = "Bash tab completion for argparse"
13category = "main"
14optional = false
15python-versions = "*"
16
17[package.extras]
18test = ["coverage", "flake8", "pexpect", "wheel"]
19
20[[package]]
21name = "attrs"
22version = "20.3.0"
23description = "Classes Without Boilerplate"
24category = "main"
25optional = false
26python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
27
28[package.extras]
29dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"]
30docs = ["furo", "sphinx", "zope.interface"]
31tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"]
32tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"]
33
34[[package]]
35name = "colorama"
36version = "0.4.4"
37description = "Cross-platform colored terminal text."
38category = "main"
39optional = false
40python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
41
42[[package]]
43name = "coverage"
44version = "5.5"
45description = "Code coverage measurement for Python"
46category = "dev"
47optional = false
48python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4"
49
50[package.extras]
51toml = ["toml"]
52
53[[package]]
54name = "dotty-dict"
55version = "1.3.0"
56description = "Dictionary wrapper for quick access to deeply nested keys."
57category = "main"
58optional = false
59python-versions = "*"
60
61[package.dependencies]
62setuptools_scm = "*"
63
64[[package]]
65name = "flake8"
66version = "3.9.0"
67description = "the modular source code checker: pep8 pyflakes and co"
68category = "dev"
69optional = false
70python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
71
72[package.dependencies]
73mccabe = ">=0.6.0,<0.7.0"
74pycodestyle = ">=2.7.0,<2.8.0"
75pyflakes = ">=2.3.0,<2.4.0"
76
77[[package]]
78name = "flake8-polyfill"
79version = "1.0.2"
80description = "Polyfill package for Flake8 plugins"
81category = "dev"
82optional = false
83python-versions = "*"
84
85[package.dependencies]
86flake8 = "*"
87
88[[package]]
89name = "hjson"
90version = "3.0.2"
91description = "Hjson, a user interface for JSON."
92category = "main"
93optional = false
94python-versions = "*"
95
96[[package]]
97name = "jsonschema"
98version = "3.2.0"
99description = "An implementation of JSON Schema validation for Python"
100category = "main"
101optional = false
102python-versions = "*"
103
104[package.dependencies]
105attrs = ">=17.4.0"
106pyrsistent = ">=0.14.0"
107six = ">=1.11.0"
108
109[package.extras]
110format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"]
111format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"]
112
113[[package]]
114name = "mccabe"
115version = "0.6.1"
116description = "McCabe checker, plugin for flake8"
117category = "dev"
118optional = false
119python-versions = "*"
120
121[[package]]
122name = "milc"
123version = "1.3.0"
124description = "Opinionated Batteries-Included Python 3 CLI Framework."
125category = "main"
126optional = false
127python-versions = "*"
128
129[package.dependencies]
130appdirs = "*"
131argcomplete = "*"
132colorama = "*"
133
134[[package]]
135name = "nose2"
136version = "0.10.0"
137description = "unittest2 with plugins, the succesor to nose"
138category = "dev"
139optional = false
140python-versions = "*"
141
142[package.dependencies]
143coverage = ">=4.4.1"
144six = ">=1.7"
145
146[package.extras]
147coverage_plugin = ["coverage (>=4.4.1)"]
148dev = ["Sphinx (>=1.6.5)", "sphinx-rtd-theme", "mock", "coverage"]
149
150[[package]]
151name = "pep8-naming"
152version = "0.11.1"
153description = "Check PEP-8 naming conventions, plugin for flake8"
154category = "dev"
155optional = false
156python-versions = "*"
157
158[package.dependencies]
159flake8-polyfill = ">=1.0.2,<2"
160
161[[package]]
162name = "pycodestyle"
163version = "2.7.0"
164description = "Python style guide checker"
165category = "dev"
166optional = false
167python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
168
169[[package]]
170name = "pyflakes"
171version = "2.3.1"
172description = "passive checker of Python programs"
173category = "dev"
174optional = false
175python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
176
177[[package]]
178name = "pygments"
179version = "2.8.1"
180description = "Pygments is a syntax highlighting package written in Python."
181category = "main"
182optional = false
183python-versions = ">=3.5"
184
185[[package]]
186name = "pyrsistent"
187version = "0.17.3"
188description = "Persistent/Functional/Immutable data structures"
189category = "main"
190optional = false
191python-versions = ">=3.5"
192
193[[package]]
194name = "setuptools-scm"
195version = "6.0.1"
196description = "the blessed package to manage your versions by scm tags"
197category = "main"
198optional = false
199python-versions = ">=3.6"
200
201[package.extras]
202toml = ["toml"]
203
204[[package]]
205name = "six"
206version = "1.15.0"
207description = "Python 2 and 3 compatibility utilities"
208category = "main"
209optional = false
210python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
211
212[[package]]
213name = "wave"
214version = "0.0.2"
215description = "Whole Architecture Verification"
216category = "dev"
217optional = false
218python-versions = "*"
219
220[[package]]
221name = "yapf"
222version = "0.30.0"
223description = "A formatter for Python code."
224category = "dev"
225optional = false
226python-versions = "*"
227
228[metadata]
229lock-version = "1.1"
230python-versions = "^3.8"
231content-hash = "6adb87c61d9eacf55e4e80bc6c73325e4e4854a792e3881ff448b6ee1cb75091"
232
233[metadata.files]
234appdirs = [
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]
238argcomplete = [
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]
242attrs = [
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]
246colorama = [
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]
250coverage = [
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]
304dotty-dict = [
305 {file = "dotty_dict-1.3.0.tar.gz", hash = "sha256:eb0035a3629ecd84397a68f1f42f1e94abd1c34577a19cd3eacad331ee7cbaf0"},
306]
307flake8 = [
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]
311flake8-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]
315hjson = [
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]
319jsonschema = [
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]
323mccabe = [
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]
327milc = [
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]
331nose2 = [
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]
335pep8-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]
339pycodestyle = [
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]
343pyflakes = [
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]
347pygments = [
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]
351pyrsistent = [
352 {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"},
353]
354setuptools-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]
358six = [
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]
362wave = [
363 {file = "Wave-0.0.2.tar.gz", hash = "sha256:5a895bb85e04e38c82dba90d66a5ae8f488b50c58f3fc4df868a5bcdcabb8632"},
364 {file = "Wave-0.0.2.zip", hash = "sha256:5187f49497287d218cc83d4cd1e5299dc31485ab3ed32abbaa9e95d8f73c4095"},
365]
366yapf = [
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]
5name = "qmk"
6version = "0.1.0"
7description = ""
8authors = []
9
10[tool.poetry.dependencies]
11python = "^3.8"
12appdirs = "^1.4.4"
13argcomplete = "^1.12.2"
14colorama = "^0.4.4"
15hjson = "^3.0.2"
16milc = "^1.1.0"
17Pygments = "^2.8.0"
18dotty-dict = "^1.3.0"
19jsonschema = "^3.2.0"
20
21[tool.poetry.dev-dependencies]
22nose2 = "^0.10.0"
23flake8 = "^3.8.4"
24pep8-naming = "^0.11.1"
25yapf = "^0.30.0"
26Wave = "^0.0.2"
27
28[build-system]
29requires = ["poetry-core>=1.0.0"]
30build-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
3let
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
173in
174mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
diff --git a/shell.nix b/shell.nix
index ab44dd8e3..e82436ae1 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,29 +1,16 @@
1{ avr ? true, arm ? true, teensy ? true }: 1{ avr ? true, arm ? true, teensy ? true }:
2
3let 2let
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 ]);
27in 14in
28 15
29with pkgs; 16with pkgs;
@@ -43,7 +30,7 @@ in
43mkShell { 30mkShell {
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