Compare commits

..

302 Commits

Author SHA1 Message Date
46388263c4 zynq: add debug messages to HITL test 2020-07-06 12:44:32 +08:00
bba16a693e zynq: power-cycle ZC706 before running tests
Like most trashy hardware of its kind, Zynq does not have a reliable reset.
2020-07-05 23:18:06 +08:00
e623036a65 zynq: add Completed message at end of HITL test 2020-07-05 20:48:40 +08:00
8e30790990 zynq: fix previous commit 2020-07-05 00:03:56 +08:00
1888638dd5 zynq: fix nix store permission problems 2020-07-05 00:02:22 +08:00
7ab53bb9eb zynq: set USER variable 2020-07-04 23:58:32 +08:00
eba5934c80 zynq: run simple kernel 2020-07-04 23:56:57 +08:00
e372f357a8 zynq: fix openocd files transfer 2020-07-04 23:46:54 +08:00
a89e2e5e5b zynq: fix ssh auth 2020-07-04 23:44:47 +08:00
0b87a11ae2 zynq: fix rpi4 host key problems (4th attempt) 2020-07-04 23:41:58 +08:00
f6e1164476 zynq: fix rpi4 host key problems (third attempt) 2020-07-04 17:41:02 +08:00
2c26169353 zynq: fix rpi4 host key problems (second attempt) 2020-07-04 17:39:10 +08:00
1a3c57864d zynq: fix rpi4 host key problems 2020-07-04 17:37:30 +08:00
3dfd3b166a zynq: use bash to execute remote-run script 2020-07-04 17:29:29 +08:00
563161860e zynq: add HITL test (WIP) 2020-07-04 17:27:42 +08:00
02899d343c extended-tests: remove IPv4 SSH host entry for rpi-1 2020-07-04 16:21:54 +08:00
50f9897c2e use new technique to access network from Hydra tests 2020-07-04 16:17:20 +08:00
eb867a355b artiq-full: add qleds 2020-07-02 16:34:15 +02:00
4578bbc74e artiq-full: remove channel constituents 2020-07-02 20:34:06 +08:00
088a101d89 windows: doc make_conda_packages.sh 2020-07-01 17:56:52 +02:00
8c508de922 artiq: add binutils-arm dependency for 6.0+ 2020-06-28 17:29:40 +08:00
48bc991c7c move wfvm.nix into artiq-fast
Avoids issue with generatedNix
2020-06-28 14:50:44 +08:00
4cd7a559e8 use external WFVM, pin WFVM nixpkgs 2020-06-28 14:46:32 +08:00
005792ed77 wfvm: restrict distribution of VS layout 2020-06-28 13:56:43 +08:00
64224a0b51 wfvm: cleanup 2020-06-28 13:56:28 +08:00
6eecb5085d wfvm: move out MSYS2 package list 2020-06-27 17:22:34 +08:00
486b343b15 windows: update conda dependencies for beta test 2020-06-27 17:06:55 +08:00
30f205680f wfvm: add RESTRICTDIST- to names of nonfree output paths
Preparation for M-Labs/nix-scripts#26
2020-06-26 20:48:34 +02:00
c00c10e223 artiq-board: fix and simplify check for timing criteria
Re-fixes Gitea issue #15
2020-06-25 00:21:48 +02:00
e87d2b4ecd windows: add back test timeout 2020-06-24 22:28:16 +08:00
d809926d10 conda-windows: try fixing llvmlite-artiq setup.py install 2020-06-24 22:22:00 +08:00
491aae094c gluelogic: add urukul-cpld-legacy 2020-06-24 19:08:52 +08:00
e347cb7c4b conda-windows: use compiled llvm-or1k for llvmlite-artiq 2020-06-23 22:27:18 +08:00
9733ec3509 llvm-or1k: bump 2020-06-23 21:18:37 +08:00
ed313133b8 conda-windows: fix llvm-or1k yaml syntax 2020-06-23 19:49:28 +08:00
69d8e02853 conda-windows: build llvmlite with VS, again 2020-06-23 19:48:53 +08:00
80bf1d300e wfvm: cleanup 2020-06-23 19:06:53 +08:00
536d45012e conda-windows: build llvm with VS, second attempt 2020-06-23 16:24:59 +08:00
4158527dba wfvm: add back MSVC 2020-06-23 16:24:59 +08:00
3f75a81ec1 artiq-fast: remove unnecessary buildInput in windows-no-hardware-tests 2020-06-22 18:05:51 +08:00
5c07a9e95d windows: fix no-hardware-tests 2020-06-22 17:53:01 +08:00
8111b2f42b windows: run tests using WFVM 2020-06-22 17:45:18 +08:00
1b79bdaa20 wfvm: set -e in scripts 2020-06-22 17:24:53 +08:00
d641e1613f artiq-fast: remove ping attempt 2020-06-22 17:20:38 +08:00
7ca6ada7ee conda-windows: do not set msys path twice in binutils 2020-06-22 16:53:40 +08:00
3766781a24 windows: do not use idiotic .conda files 2020-06-22 16:48:11 +08:00
5dc2ed0c79 conda: do not depend on Python
python dependency just seems to cause more misbehavior of the crappy conda dep handler.
2020-06-22 15:41:28 +08:00
72d4eab21b conda: remove version specification from deps
They just seem to tickle bugs in conda's shitty excuse for a dependency solver.
2020-06-22 15:29:00 +08:00
11dfff09b9 artiq-fast: fix a448d3bdc 2020-06-22 15:22:25 +08:00
97bb368cab conda: do not specify h5py 2.8
h5py 2.8 sometimes causes the conda crap to install Python 3.5.
2020-06-22 15:18:47 +08:00
a448d3bdc0 artiq-fast: organize 2020-06-22 15:13:02 +08:00
05cde854dd windows: add script to automatically download conda dependencies and create fetchurl nix files 2020-06-22 14:56:02 +08:00
bd8fa5d955 wfvm: support disabling fake RTC
Avoids SSL 'certificate not yet valid' errors.
2020-06-22 14:43:02 +08:00
d895203b5b conda-windows: add binutils-arm again 2020-06-22 12:57:52 +08:00
7838d6e683 conda-windows: make binutils generic 2020-06-22 12:57:29 +08:00
b2e40e0594 conda-windows: new attempt at binutils 2020-06-22 12:33:36 +08:00
dd377e0459 wfvm: remove CMake
Better install via MSYS2 if needed.
2020-06-20 19:58:49 +08:00
ffed59ad95 wfvm: remove Visual Studio
Installer is a piece of trash and won't work reliably in command line.
2020-06-20 19:58:20 +08:00
8c8ede8387 wfvm: increase VM disk image size
Windows software is seriously bloated.
2020-06-20 19:52:22 +08:00
942c654af0 conda-windows: also enable on stable channel 2020-06-20 18:33:29 +08:00
90cc2c5049 split into it-infra 2020-06-20 17:53:53 +08:00
77722ae68b wfvm: do not use virtio graphics (driver not installed) 2020-06-20 14:23:49 +08:00
8fa63fe916 commit missing file 2020-06-20 13:57:06 +08:00
561eb3a02e conda-windows: redistribute old packages 2020-06-20 13:56:15 +08:00
Your Name
5ef34eff97 conda-windows: work around more conda build dependency handling idiocy 2020-06-19 09:54:37 +08:00
131df3a337 nixops: set astro's shell to bashInteractive
I hope this is lighter than `programs.zsh.enable = true;`
2020-06-18 16:19:42 +02:00
0e4d2e3b54 conda-windows: fix name of conda package for VS activation 2020-06-18 19:06:23 +08:00
ae201e2aa8 wfvm: fix VS download 2020-06-18 18:50:01 +08:00
b30fa47e53 conda-windows: try to use conda package for VS activation 2020-06-18 18:48:54 +08:00
e589989955 wfvm: install Win8.1 SDK in VS 2020-06-18 18:19:46 +08:00
df38a58ae7 conda-windows: fix previous commit 2020-06-18 16:34:19 +08:00
eb4fa6ee15 conda-windows: fix llvm-or1k after 9479f297fc 2020-06-18 16:28:57 +08:00
7ff56838b6 conda-windows: build llvm with VS (WIP) 2020-06-18 16:22:05 +08:00
f18d1d70d2 nixops: disable geary
breaks without gnome-keyring
2020-06-18 16:06:34 +08:00
9479f297fc conda-windows: restrict to beta channel
Windoze is a truly horrible excuse for a OS and there have been lots of problems with those packages.
2020-06-18 16:05:20 +08:00
330636726c wfvm: downgrade visual studio to 2017
The conda garbage does not support later versions.
2020-06-18 15:34:55 +08:00
21f3b682c5 wfvm: get the visual studio installer to work
It is chock full of bugs and also the instructions on the microsoft website are wrong.
2020-06-18 14:16:56 +08:00
2db006aa19 Revert "nixops: enable fish-nix-shell on rpi"
Still fails with 'exec format error'.

This reverts commit 3e19ee59c9.
2020-06-18 11:12:28 +08:00
d64fcec76e wfvm: use absolute path for VS layout creation 2020-06-18 11:09:36 +08:00
f1325dce29 artiq-board.nix: move inputs outside inner function, accept vivado as arg to cut memory usage 2020-06-17 23:20:23 +02:00
08d28437e4 wfvm: new visual studio installation technique 2020-06-18 01:58:09 +08:00
1bf63a88ad wfvm: fix win-get of directory 2020-06-18 01:55:53 +08:00
6d2d0745e0 conda-windows: be more selective when copying conda packages 2020-06-18 00:10:57 +08:00
0e446db26e wfvm: fix win-get path problems 2020-06-18 00:10:33 +08:00
ab90fc88f6 wfvm: disable SSH host key warning messages 2020-06-17 23:42:22 +08:00
0f99ffc583 wfvm: use sftp instead of scp
scp is bogged down transferring the 13k files of the Visual Studio pile of garbage.
2020-06-17 23:40:49 +08:00
465cc193ec wfvm: add official cmake msi 2020-06-17 21:51:36 +08:00
a5b336f63c wfvm: add MSVC layer 2020-06-17 17:45:57 +08:00
aa76904361 wfvm: fix indentation 2020-06-17 17:08:35 +08:00
3d41477178 wfvm: support transferring folders recursively 2020-06-17 17:02:24 +08:00
3e19ee59c9 nixops: enable fish-nix-shell on rpi 2020-06-17 12:31:16 +08:00
7ac26d6348 nixops: disable mutableUsers 2020-06-17 12:29:56 +08:00
a676854640 nixops: add harry to wireshark group 2020-06-17 12:23:58 +08:00
6437ef3070 nixbld: cleanup system packages 2020-06-17 12:23:37 +08:00
dd688f7c11 conda: fix 40311dc33 2020-06-16 19:50:13 +08:00
5b5742c3f0 wfvm: upgrade Anaconda
The previous version craps out when installing sipyco from a channel (but not from a file, go figure.)
2020-06-16 19:46:50 +08:00
96ba1fab12 wfvm: autologin user
This makes manual testing of GUI applications easier.
2020-06-16 19:06:20 +08:00
40311dc33d conda: add numpy dependency to sipyco 2020-06-16 17:33:16 +08:00
dc8df8660a conda-windows: build llvmlite-artiq 2020-06-16 16:23:47 +08:00
20925a3d8d conda-windows: build llvm-or1k 2020-06-16 15:32:48 +08:00
90150c7dbe wfvm: install msys mingw make and cmake 2020-06-16 15:14:50 +08:00
d407eee013 wfvm: revert accidentally committed part of f464b61290 2020-06-16 14:49:16 +08:00
4272fe445c conda-windows: clean up msys path 2020-06-16 14:05:47 +08:00
5be1c8aa4a wfvm: make everything 64-bit 2020-06-16 13:29:40 +08:00
978ea89fe0 wfvm: install cmake in msys2 packages 2020-06-16 13:16:03 +08:00
f464b61290 conda-windows: fix binutils target handling 2020-06-16 12:52:42 +08:00
d75e222bfc conda-windows: add libiconv dependency to binutils 2020-06-16 12:44:57 +08:00
448905f06e conda-windows: do not include binutils source in recipe
Otherwise conda includes it in the final package and bloats it.
2020-06-15 20:20:40 +08:00
7e50d7de1c conda-windows: build binutils via WFVM 2020-06-15 20:16:11 +08:00
5ab186e3dc wfvm: allow network access in SSH demo 2020-06-15 20:16:11 +08:00
0ba8000660 wfvm: fix 'protocol error: filename does not match request' in win-get 2020-06-15 20:16:11 +08:00
38d7c89a8b wfvm: fix QEMU not found in wfvm-run 2020-06-15 20:16:11 +08:00
72357a62f1 wfvm: make demo image more like default 2020-06-15 20:16:11 +08:00
cb359a0ceb rpi: use upstream kernel 2020-06-15 18:13:31 +08:00
b1bb414a74 nixops: install chromium 2020-06-15 16:55:34 +08:00
17b8869da2 nixbld: remove yubico otp 2020-06-15 16:55:34 +08:00
dcb8e499df wfvm: automate make_msys_packages.sh 2020-06-15 14:05:14 +08:00
107340b08a wfvm: add win-get 2020-06-15 14:05:14 +08:00
ded12b51fd wfvm: set default windows image parameters 2020-06-15 14:05:14 +08:00
cc37c8232d wfvm: improve SSH use 2020-06-15 14:05:14 +08:00
876f278fdb wfvm: use '-display none' instead of '-nographic' 2020-06-15 14:05:14 +08:00
873b2a0287 nixops,nixbld: update SSH keys 2020-06-15 00:32:34 +08:00
4510ae7552 wfvm: reorganize, add demo-ssh 2020-06-15 00:29:01 +08:00
18f84a65c6 wfvm: remove unnecessary HOME 2020-06-15 00:29:01 +08:00
cc14162e60 wfvm: cleanup, move QEMU netdev settings out of defaults 2020-06-15 00:29:01 +08:00
70c6a212e2 nixops: yubikey piv auth 2020-06-14 22:52:17 +08:00
cfc20a13c5 nixops: use git for nixos-unstable instead of (stale) channel 2020-06-14 22:51:00 +08:00
8fc3860e9d conda-channel: create win-64 output 2020-06-14 22:50:02 +08:00
a9830e0a51 wfvm: remove direnv file (accidentally committed?) 2020-06-14 21:59:38 +08:00
7c758967e0 wfvm: remove more dead code 2020-06-14 17:08:18 +08:00
996802257d wfvm: clean up nix imports 2020-06-14 17:06:03 +08:00
446dbbfbf2 wfvm: remove more dead code 2020-06-14 17:05:28 +08:00
0a2e7dae93 wfvm: remove dead code 2020-06-14 16:57:59 +08:00
768d38db46 wfvm: remove installation 'settling' nonsense
Corruption was caused by the VM being killed instead of cleanly shut down.
2020-06-14 16:47:55 +08:00
aa0e0517c2 wfvm: wait for VM to terminate instead of killing it 2020-06-14 12:23:22 +08:00
10bb7df7ed wfvm: reorganize 2020-06-14 12:23:22 +08:00
a808a5d090 wfvm: install MSYS compiler packages 2020-06-14 12:23:22 +08:00
d652347dc7 nixbld: remove obsolete iwlwifi-related firmware override 2020-06-14 00:40:30 +08:00
596f4cf4b9 nixbld: unbreak hydra sysbuild 2020-06-14 00:37:41 +08:00
088403cf6f wfvm: remove duplicated SSH code 2020-06-13 18:57:50 +08:00
75c44b0369 wfvm: install MSYS2 2020-06-13 18:57:50 +08:00
72d155c047 wfvm: Use OpenSSH instead of Paramiko
The Paramiko hack does not stream stdout/stderr and makes debugging or using expect problematic.
2020-06-13 18:57:50 +08:00
22a8a5ed92 wfvm: let layers have build inputs 2020-06-13 18:57:50 +08:00
b8a7f84483 wfvm: avoid copying large anaconda installer file 2020-06-13 18:57:50 +08:00
40e8cc8407 add wfvm 2020-06-13 18:57:50 +08:00
b6c186b632 nixbld: use own DNS resolver 2020-06-13 13:58:26 +08:00
98e6c29401 vivado: update to 2020.1 2020-06-11 13:23:15 +08:00
e15a0235a3 Revert "migen: add patch to limit vivado threads to 1"
This reverts commit 8f7308b036.
2020-06-11 08:18:02 +08:00
8f7308b036 migen: add patch to limit vivado threads to 1 2020-06-10 19:42:17 +02:00
dc2c495293 conda: update artiq dependencies 2020-06-10 21:46:36 +08:00
5bc76b0959 artiq-full: disable berkeley build 2020-06-10 18:05:26 +08:00
27c3940955 libartiq-support: no more build in lit.cfg 2020-06-10 17:16:01 +08:00
6313687278 remove artiq dependency on rustc 2020-06-10 17:09:43 +08:00
1ffce94d92 conda: handle architecture-dependent packages in channel 2020-06-10 12:05:01 +08:00
f1742db24f conda: add llvmlite-artiq 2020-06-10 11:53:43 +08:00
c7fa00304b conda: also show architecture-dependent packages in build products 2020-06-10 11:44:19 +08:00
649124a463 conda: add quamash
Closes #24
2020-06-10 11:43:41 +08:00
1f4639c7e4 conda: fix system shared libs not found in conda-build (#24) 2020-06-10 11:43:09 +08:00
0292090670 conda: include ARM support in llvm-or1k 2020-06-09 18:29:40 +08:00
20c2871896 conda: build llvm-or1k 2020-06-09 18:21:54 +08:00
9e900d321e conda: add binutils.nix 2020-06-09 17:30:40 +08:00
e9c07a8985 conda: build binutils 2020-06-09 17:29:38 +08:00
ef8664443a artiq-full: fix more conda paths 2020-06-09 16:24:14 +08:00
ffaa3f74ec artiq-full: fix conda paths 2020-06-09 16:11:08 +08:00
37e70bbda1 conda: build asyncserial 2020-06-09 16:08:14 +08:00
68078d38d8 artiq: use nixpkgs levenshtein 2020-06-09 15:52:36 +08:00
b7d872a720 nixops: disable powerManagement 2020-06-09 15:48:47 +08:00
bf9f5804e2 nixops: install gitAndTools.gitFull 2020-06-09 15:48:35 +08:00
f03d0370db artiq: use nixpkgs quamash 2020-06-09 15:47:35 +08:00
7ab028deb6 conda: build pythonparser 2020-06-09 15:43:18 +08:00
0581ac7b69 conda: build bscan-spi-bitstreams 2020-06-09 15:29:18 +08:00
245b96a844 conda: remove unneeded PYTHON env var 2020-06-09 15:12:37 +08:00
456a21d363 conda: update system deps
List copied from nixpkgs.conda.
2020-06-09 15:12:11 +08:00
5d8ffd44ef move conda files to dedicated folder 2020-06-09 14:30:23 +08:00
38eff183a8 artiq-full: build sydney 2020-06-08 18:46:02 +08:00
2edf38876d nixops: enable SSH agent with opensc on desktop machines 2020-06-04 19:34:55 +08:00
d6691c2e68 gluelogic: build Fastino gateware 2020-05-31 16:57:54 +08:00
e2c1948931 cpld -> gluelogic 2020-05-31 16:47:30 +08:00
6ac087c823 artiq: move stable to nixos 20.03 2020-05-30 14:20:25 +08:00
a7ebb7c834 Revert "artiq-full: simpler workaround for https://github.com/NixOS/nixpkgs/pull/85763"
Fixed upstream.

This reverts commit aa21bde6e5.
2020-05-30 14:18:48 +08:00
3801458324 artiq-full: restore ist 2020-05-30 14:10:23 +08:00
47e7231ee0 nixbld: add DNS entry for metlino 2020-05-29 15:45:20 +08:00
4b29022876 misoc: bump 2020-05-29 15:41:03 +08:00
16fdb7465d luh3: add 2020-05-28 16:54:10 +02:00
6acdcdb180 artiq-full: build osaka 2020-05-28 17:20:42 +08:00
46738cea8c nixops: add dsleung user 2020-05-28 17:19:29 +08:00
7c9068c9cc nixops: disable gnome web browser 2020-05-28 17:19:09 +08:00
3e4034f936 nixops: add new desktop machines 2020-05-28 17:17:41 +08:00
170e2b3dae artiq-full: add conda package for kasli-tester 2020-05-26 17:00:25 +08:00
aa21bde6e5 artiq-full: simpler workaround for https://github.com/NixOS/nixpkgs/pull/85763 2020-05-26 15:50:49 +08:00
e9d050d1e1 Revert "artiq-full: simpler workaround for https://github.com/NixOS/nixpkgs/pull/85763"
Still breaks hydra-eval-job.

This reverts commit ca4f299ab9.
2020-05-26 15:45:07 +08:00
ca4f299ab9 artiq-full: simpler workaround for https://github.com/NixOS/nixpkgs/pull/85763 2020-05-26 15:42:44 +08:00
f9c728aab7 Revert "artiq-full: work around https://github.com/NixOS/nixpkgs/pull/85763"
Makes hydra-eval-job OOM for some reason.

This reverts commit ced0ef13b3.
2020-05-26 15:38:06 +08:00
ced0ef13b3 artiq-full: work around https://github.com/NixOS/nixpkgs/pull/85763 2020-05-26 15:32:26 +08:00
c4eae355d3 add rpi-5 2020-05-25 16:31:04 +08:00
a110358e37 nixops: yubikey udev 2020-05-21 12:35:46 +08:00
00ccf48332 nixops: update SSH settings for yubikey 2020-05-21 12:25:12 +08:00
2f1b8ad0f4 enable gitea email notifications 2020-05-21 12:24:38 +08:00
c3089d0730 uaarhus, ugranada: add 2020-05-19 17:15:39 +02:00
db65504dab migen: bump 2020-05-14 15:09:25 +08:00
7bd6523807 nixops: add zeus machine 2020-05-13 14:21:51 +08:00
cc8f6d9ae8 nixops: add udev rules for saleae + oceanoptics 2020-05-13 14:21:34 +08:00
86907b40cc nixops: more dev packages 2020-05-13 14:21:14 +08:00
d05caf3468 nixops: install mode dev tools on desktop 2020-05-10 15:45:26 +08:00
bd33e26a40 nixops: common users, gnome, disable SSH password, light config 2020-05-09 21:52:00 +08:00
95ccdcc5be misoc: bump 2020-05-09 16:43:58 +08:00
43967e2324 migen: bump 2020-05-07 12:57:18 +08:00
6a1476405d nixops: create occheung account 2020-05-07 12:55:08 +08:00
19310060e0 nixops: prevent cups from creating broken and conflicting printer entries
https://askubuntu.com/questions/345083/how-do-i-disable-automatic-remote-printer-installation
2020-05-03 14:15:20 +08:00
9695aaf74f zynq: build experiments again 2020-05-03 09:46:28 +08:00
dc1e0cf3d7 rpi: update users 2020-05-03 09:43:52 +08:00
1af80bace3 zynq: syntax 2020-05-03 01:49:57 +02:00
5a5c832de2 zynq: remove args 2020-05-03 01:45:54 +02:00
1bfe9be055 zynq: try to filter for "zc706-" jobs 2020-05-03 01:36:49 +02:00
bc03ef956e hydra: rename zc706 to zynq 2020-05-01 14:11:02 +08:00
bb1658990a zc706: works in nix-build. hydra still breaks for obscure reason 2020-05-01 11:56:53 +08:00
b1accc9810 zc706: trying to understand evaluation problems... 2020-05-01 11:51:10 +08:00
a6d5f444d1 zc706: trying to understand evaluation problems... 2020-05-01 11:40:43 +08:00
96578b9ad7 zc706: trying to understand evaluation problems... 2020-05-01 11:40:10 +08:00
69390df36d zc706: trying to understand evaluation problems... 2020-05-01 11:39:02 +08:00
1110d6fbb8 zc706: trying to understand evaluation problems... 2020-05-01 11:37:36 +08:00
d11d73c246 zc706: fix mapAttrs 2020-05-01 11:35:05 +08:00
06757b311a zc706: build artiq-zynq 2020-05-01 11:30:01 +08:00
556fda274d update nmigen.org redirect 2020-04-29 16:20:04 +08:00
1e568b244b desktop: remove whois 2020-04-29 15:23:20 +08:00
cfc843819d nixops: create pca006132 account 2020-04-27 16:30:50 +08:00
50f7c293e8 nixbld: fix recurring acme certificate permission problems 2020-04-27 11:59:08 +08:00
3cface01af artiq-comtools: bump 2020-04-25 12:47:23 +08:00
aac80b9f84 misoc: bump 2020-04-23 23:07:42 +08:00
38a66c9d41 migen: bump 2020-04-23 23:05:59 +08:00
fa7c3d2454 nixpkgs 20.03 updates 2020-04-20 17:51:38 +08:00
5dd966ceb0 remove pyftdi (upstream nixpkgs) 2020-04-20 17:49:45 +08:00
f7f3ec9a37 nixbld: update hydra 2020-04-20 15:37:46 +08:00
4b92e7c00f nixbld: remove munin workaround (no longer needed on 20.03) 2020-04-20 14:24:45 +08:00
7f6d54c6cd upgrade to nixos 20.03 2020-04-20 14:21:48 +08:00
b37f00336e artiq-full: build oklahoma 2020-04-18 18:35:03 +08:00
55593d3210 artiq-full: rm archived systems 2020-04-17 21:21:03 +08:00
9c86d4b797 nixops: disable fish-nix-shell on rpi (buggy) 2020-04-16 16:30:41 +08:00
d7dbb1b1c1 nixbld: plugdev permissions for common devices 2020-04-16 16:14:35 +08:00
aea9642136 nixops: add cnc machine 2020-04-16 13:08:51 +08:00
c9137824e9 nixops: cleanup 2020-04-16 13:08:33 +08:00
d939fd7c1a nixops: update SSH keys 2020-04-16 13:08:17 +08:00
6e8e2824a9 nixops: use fish and fish-nix-shell consistently 2020-04-16 13:06:23 +08:00
9617de32f9 mattermost-github-integration: pin src rev 2020-04-16 03:00:29 +02:00
a8198e9eea nixbld: add shop email backend 2020-04-15 21:15:26 +08:00
ec732461cb nixops/desktop: update package collection 2020-04-12 10:03:35 +08:00
2b08520101 nixbld: add second ZC706 IP address 2020-04-11 22:10:20 +08:00
b13b90f661 migen: bump 2020-04-11 18:00:25 +08:00
61be83c730 migen-axi: bump 2020-04-10 17:50:41 +08:00
e8342cdf6b misoc: bump 2020-04-10 17:50:34 +08:00
57891b5cae migen-axi: fix compat with nixpkgs 19.09 2020-04-10 17:12:50 +08:00
58f507580a zc706: build on nixos 20.03 2020-04-10 16:51:42 +08:00
438123f76e migen-axi: bump 2020-04-10 15:47:39 +08:00
a59a543f81 artiq-full: build no 2020-04-04 20:27:04 +08:00
179d74a137 nixbld: setup second red pitaya 2020-04-04 18:03:48 +08:00
0c6418755e build ARTIQ beta against nixpkgs 20.03 2020-04-04 13:04:56 +08:00
7d740fd464 lock cargo and cargo-vendor
With nixpkgs 20.03, the provided cargo package can no longer use the old rustc-or1k.
2020-04-04 13:02:18 +08:00
6888f2dfd2 urukul: bump CPLD release 2020-04-03 17:30:00 +08:00
9015e109c0 artiq-full: build new systems 2020-04-01 21:52:13 +08:00
49f5af3eca desktop: add astro user 2020-03-31 14:11:58 +08:00
bad4c09735 artiq-full: disable archived variants 2020-03-27 13:27:23 +08:00
e7b886f07a remove sjm user 2020-03-27 13:14:22 +08:00
5c43dbd0ea stm32: update rust-nightly 2020-03-23 18:42:30 +01:00
Stewart Mackenzie
fafc71610d added ustc2 2020-03-19 17:32:40 +08:00
dec885c896 set stabilizer IP address within M-Labs network 2020-03-17 19:43:22 +08:00
b72369d457 nixops: add rj account to rpi 2020-03-17 13:26:09 +08:00
57715ff325 nixbld: static IP for Red Pitaya 2020-03-17 13:25:46 +08:00
3dfe8d9902 artiq-full: hw2 is ARTIQ-6+ only (Mirny) 2020-03-16 19:03:41 +08:00
78c3352fb9 artiq-full: add olomouc 2020-03-16 11:18:19 +01:00
bb8e95a805 rpi: add vince account 2020-03-14 11:13:04 +08:00
c6724c4884 artiq-full: add uamsterdam 2020-03-11 11:50:20 +01:00
a90944bb5f disable mitll/mitll2 builds 2020-03-11 10:37:33 +08:00
687a09d957 femto[123]: add 2020-03-08 19:21:11 +01:00
37e464755f nixops: update desktop accounts 2020-03-07 21:09:35 +08:00
bc876fa374 unlb -> unlv 2020-03-05 14:09:54 +08:00
Stewart Mackenzie
010de9691e added unlb 2020-03-04 17:29:46 +08:00
Stewart Mackenzie
6db4ccfaa4 added hw2 master + satellite 2020-03-04 17:29:38 +08:00
Stewart Mackenzie
36fa4372cd added berkeley3 2020-03-04 17:28:52 +08:00
Stewart Mackenzie
fccd9ea62a added liaf 2020-02-19 14:37:59 +08:00
8e36ea82a6 artiq-full: add vtt-mikes 2020-02-14 17:17:32 +01:00
Stewart Mackenzie
46624ad101 rename grif -> griffith 2020-02-09 18:13:43 +08:00
Stewart Mackenzie
6b8e2171fc artiq_full: add grif 2020-02-07 18:44:32 +08:00
8d29d163f2 built mitll4 2020-02-06 16:59:37 +08:00
b0407a3775 migen: bump 2020-02-05 00:08:07 +08:00
9f5be63f8e migen: bump 2020-02-04 17:43:27 +08:00
0217471462 built mitll3 2020-01-31 17:26:19 +08:00
9ee661049c use temporary redirect code 2020-01-30 11:33:51 +08:00
125654bcce redirect nmigen domain to github repos 2020-01-30 11:31:21 +08:00
3091d20e23 fix previous commit 2020-01-29 10:01:34 +08:00
29da8f5ab2 bump toptica-lasersdk-artiq 2020-01-27 22:59:38 +08:00
99fd8085ed hydra/artiq: add zc706 2020-01-26 01:39:44 +01:00
987d1d93d3 build rice 2020-01-23 19:34:43 +08:00
102341dcf1 add builds for new systems 2020-01-21 15:46:02 +08:00
14fe3d5a56 revert accidentally committed part of beee821588 2020-01-21 13:55:18 +08:00
d11f13ce3a jesd204: bump 2020-01-20 20:25:25 +08:00
7efd520ba5 jesd204: bump 2020-01-20 15:57:49 +08:00
4c6daeda64 migen: bump 2020-01-20 13:00:31 +08:00
369c167327 jesd204: bump 2020-01-20 12:50:10 +08:00
d26906d6d0 bump migen and misoc 2020-01-18 10:26:16 +08:00
661f0ba142 artiq-full: add luh2 2020-01-06 18:07:13 +01:00
f927de3280 openocd: use --disable-werror
Unbreaks build with recent GCC.
2020-01-06 12:33:30 +08:00
beee821588 nixops: update permissions 2020-01-06 10:53:45 +08:00
82 changed files with 6598 additions and 3693 deletions

View File

@ -31,20 +31,11 @@ let
echo "{ stdenv, git, fetchgit }: \"$MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`$SUFFIX\"" > $out/pkgs/artiq-version.nix echo "{ stdenv, git, fetchgit }: \"$MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`$SUFFIX\"" > $out/pkgs/artiq-version.nix
echo "{ stdenv, git, fetchgit }: \"$TIMESTAMP\"" > $out/pkgs/artiq-timestamp.nix echo "{ stdenv, git, fetchgit }: \"$TIMESTAMP\"" > $out/pkgs/artiq-timestamp.nix
''; '';
generateTestOkHash = pkgs.runCommand "generate-test-ok-hash" { buildInputs = [ pkgs.nix ]; }
''
TMPDIR=`mktemp -d`
cp ${generatedNix}/pkgs/artiq-version.nix $TMPDIR/passed
HASH=`nix-hash --type sha256 --base32 $TMPDIR`
echo \"$HASH\" > $out
'';
artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; }; artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; };
artiqVersion = import "${generatedNix}/pkgs/artiq-version.nix" (with pkgs; { inherit stdenv fetchgit git; }); artiqVersion = import "${generatedNix}/pkgs/artiq-version.nix" (with pkgs; { inherit stdenv fetchgit git; });
windowsRunner = overrides: windowsRunner = overrides:
import "${generatedNix}/windows/run-test.nix" ({ import "${generatedNix}/windows/run-test.nix" ({
inherit pkgs; inherit pkgs artiqpkgs;
sipycoPkg = artiqpkgs.conda-sipyco;
artiqPkg = artiqpkgs.conda-artiq;
} // overrides); } // overrides);
jobs = (builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiqpkgs); jobs = (builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiqpkgs);
in in
@ -58,32 +49,23 @@ in
windows-no-hardware-tests = pkgs.stdenv.mkDerivation { windows-no-hardware-tests = pkgs.stdenv.mkDerivation {
name = "windows-no-hardware-tests"; name = "windows-no-hardware-tests";
buildInputs = [ (windowsRunner {}) ];
phases = [ "buildPhase" ]; phases = [ "buildPhase" ];
buildPhase = '' buildPhase = ''
${windowsRunner {}}/bin/run.sh ${windowsRunner { testCommand = "python -m unittest discover -v sipyco.test && python -m unittest discover -v artiq.test"; }}/bin/wfvm-run-windows-tests
touch $out touch $out
''; '';
}; };
# HACK: Abuse fixed-output derivations to escape the sandbox and run the hardware
# unit tests, all integrated in the Hydra interface.
# One major downside of this hack is the tests are only run when generateTestOkHash
# changes, i.e. when the ARTIQ version changes (and not the dependencies).
# Impure derivations, when they land in Nix/Hydra, should improve the situation.
extended-tests = pkgs.stdenv.mkDerivation { extended-tests = pkgs.stdenv.mkDerivation {
name = "extended-tests"; name = "extended-tests";
outputHashAlgo = "sha256"; # requires patched Nix
outputHashMode = "recursive"; __networked = true;
outputHash = import generateTestOkHash;
__hydraRetry = false;
buildInputs = [ buildInputs = [
(pkgs.python3.withPackages(ps: [ ps.paramiko artiqpkgs.artiq artiqpkgs.artiq-board-kc705-nist_clock ])) (pkgs.python3.withPackages(ps: [ ps.paramiko artiqpkgs.artiq artiqpkgs.artiq-board-kc705-nist_clock ]))
artiqpkgs.binutils-or1k artiqpkgs.binutils-or1k
artiqpkgs.openocd artiqpkgs.openocd
pkgs.iputils
pkgs.openssh pkgs.openssh
]; ];
phases = [ "buildPhase" ]; phases = [ "buildPhase" ];
@ -93,7 +75,7 @@ in
mkdir $HOME/.ssh mkdir $HOME/.ssh
cp /opt/hydra_id_rsa $HOME/.ssh/id_rsa cp /opt/hydra_id_rsa $HOME/.ssh/id_rsa
cp /opt/hydra_id_rsa.pub $HOME/.ssh/id_rsa.pub cp /opt/hydra_id_rsa.pub $HOME/.ssh/id_rsa.pub
echo "rpi-1,192.168.1.188 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMc7waNkP2HjL5Eo94evoxJhC8CbYj4i2n1THe5TPIR3" > $HOME/.ssh/known_hosts echo "rpi-1 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMc7waNkP2HjL5Eo94evoxJhC8CbYj4i2n1THe5TPIR3" > $HOME/.ssh/known_hosts
chmod 600 $HOME/.ssh/id_rsa chmod 600 $HOME/.ssh/id_rsa
LOCKCTL=$(mktemp -d) LOCKCTL=$(mktemp -d)
mkfifo $LOCKCTL/lockctl mkfifo $LOCKCTL/lockctl
@ -115,18 +97,15 @@ in
artiq_flash -t kc705 -H rpi-1 artiq_flash -t kc705 -H rpi-1
sleep 15 sleep 15
# ping: socket: Operation not permitted
#ping kc705-1 -c10 -w30
export ARTIQ_ROOT=`python -c "import artiq; print(artiq.__path__[0])"`/examples/kc705_nist_clock export ARTIQ_ROOT=`python -c "import artiq; print(artiq.__path__[0])"`/examples/kc705_nist_clock
export ARTIQ_LOW_LATENCY=1 export ARTIQ_LOW_LATENCY=1
python -m unittest discover -v artiq.test.coredevice python -m unittest discover -v artiq.test.coredevice
${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\anaconda\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&&python -m unittest discover -v artiq.test.coredevice"; }}/bin/run.sh ${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\Anaconda3\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&& python -m unittest discover -v artiq.test.coredevice"; }}/bin/wfvm-run-windows-tests
) )
mkdir $out touch $out
cp ${generatedNix}/pkgs/artiq-version.nix $out/passed
''; '';
}; };
} }

View File

@ -1,19 +1,16 @@
# Install Vivado in /opt and add to /etc/nixos/configuration.nix: # Install Vivado in /opt and add to /etc/nixos/configuration.nix:
# nix.sandboxPaths = ["/opt"]; # nix.sandboxPaths = ["/opt"];
{ pkgs }: { pkgs
{ target , vivado ? import ./vivado.nix { inherit pkgs; }
, variant }:
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
, extraInstallCommands ? ""}:
let let
name = "artiq-board-${target}-${variant}-${version}";
version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
installPath = "${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}";
artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; }; artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
artiqpkgs = import ./default.nix { inherit pkgs; };
fetchcargo = import ./fetchcargo.nix { fetchcargo = import ./fetchcargo.nix {
inherit (pkgs) stdenv cacert git cargo cargo-vendor; inherit (pkgs) stdenv cacert git;
inherit (artiqpkgs) cargo cargo-vendor;
}; };
cargoDeps = fetchcargo rec { cargoDeps = fetchcargo rec {
name = "artiq-firmware-cargo-deps"; name = "artiq-firmware-cargo-deps";
@ -45,20 +42,23 @@ let
''; '';
}; };
vivado = import ./vivado.nix { inherit pkgs; }; in
artiqpkgs = import ./default.nix { inherit pkgs; }; { target
, variant
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
, extraInstallCommands ? ""}:
# Board packages are Python modules so that they get added to the ARTIQ Python # Board packages are Python modules so that they get added to the ARTIQ Python
# environment, and artiq_flash finds them. # environment, and artiq_flash finds them.
boardModule = pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation { pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec {
name = "${name}-firmware"; name = "artiq-board-${target}-${variant}-${version}";
inherit version; version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
phases = [ "buildPhase" "installCheckPhase" "installPhase" ]; phases = [ "buildPhase" "installCheckPhase" "installPhase" "checkPhase" ];
buildInputs = [ buildInputs = [
vivado vivado
pkgs.gnumake pkgs.which pkgs.gnumake
(pkgs.python3.withPackages(ps: with ps; [ jinja2 numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq ])) (pkgs.python3.withPackages(ps: with ps; [ jinja2 numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq ]))
pkgs.cargo artiqpkgs.cargo
artiqpkgs.rustc artiqpkgs.rustc
artiqpkgs.binutils-or1k artiqpkgs.binutils-or1k
artiqpkgs.llvm-or1k artiqpkgs.llvm-or1k
@ -67,33 +67,22 @@ let
'' ''
export CARGO_HOME=${cargoVendored} export CARGO_HOME=${cargoVendored}
export TARGET_AR=or1k-linux-ar export TARGET_AR=or1k-linux-ar
${buildCommand} --no-compile-gateware ${buildCommand}
'';
doCheck = true;
checkPhase = ''
# Search for PCREs in the Vivado output to check for errors
check_log() {
grep -Pe "$1" artiq_${target}/${variant}/gateware/vivado.log && exit 1 || true
}
check_log "\d+ constraint not met\."
check_log "Timing constraints are not met\."
''; '';
installPhase = installPhase =
'' ''
TARGET_DIR=$out/${installPath} TARGET_DIR=$out/${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}
mkdir -p $TARGET_DIR $out/src mkdir -p $TARGET_DIR
cp artiq_${target}/${variant}/gateware/top.bit $TARGET_DIR
cp -ar artiq_${target}/${variant}/gateware $out/src/
pushd $out/src/gateware
LIB_PATH=$(dirname $(dirname $(which python)))/${pkgs.python3Packages.python.sitePackages}
(
set -e
cd $LIB_PATH
for EXT in v vh
do
find misoc/ -name "*.$EXT" -type f
done
) | while read V
do
SRC=$LIB_PATH/$V
mkdir -p $(dirname $V)
cp $SRC $V
substituteInPlace top.tcl --replace $SRC $V \
2> /dev/null
done
popd
if [ -e artiq_${target}/${variant}/software/bootloader/bootloader.bin ] if [ -e artiq_${target}/${variant}/software/bootloader/bootloader.bin ]
then cp artiq_${target}/${variant}/software/bootloader/bootloader.bin $TARGET_DIR then cp artiq_${target}/${variant}/software/bootloader/bootloader.bin $TARGET_DIR
fi fi
@ -103,60 +92,4 @@ let
fi fi
${extraInstallCommands} ${extraInstallCommands}
''; '';
}); })
gatewareSourceArchive = pkgs.stdenv.mkDerivation {
name = "${name}-gateware-source.nar.base64";
buildInputs = [ pkgs.nix ];
phases = [ "installPhase" ];
installPhase = "nix-store --dump ${boardModule}/src/gateware | base64 -w0 > $out";
};
# Funnelling the source code through a Nix string allows dropping
# all dependencies via `unsafeDiscardStringContext`. The gateware
# will then be rebuilt only when these contents have changed.
pureGatewareSourceArchive = builtins.toFile "${name}-gateware-source.nar.base64" (
builtins.unsafeDiscardStringContext (
builtins.readFile gatewareSourceArchive
));
# Depends on just Vivado and the generated Bitstream source
gateware = pkgs.stdenvNoCC.mkDerivation {
name = builtins.unsafeDiscardStringContext "${name}-gateware";
unpackPhase = "base64 -d < ${pureGatewareSourceArchive} | nix-store --restore gateware";
buildInputs = [ vivado pkgs.nix ];
buildPhase = ''
cd gateware
vivado -mode batch -source top.tcl
'';
installPhase = ''
TARGET_DIR=$out/${builtins.unsafeDiscardStringContext installPath}
mkdir -p $TARGET_DIR
chmod a+r top.bit
cp top.bit $TARGET_DIR
'';
doCheck = true;
checkPhase = ''
# Search for PCREs in the Vivado output to check for errors
check_log() {
set +e
grep -Pe "$1" vivado.log
FOUND=$?
set -e
if [ $FOUND != 1 ]; then
exit 1
fi
}
check_log "\d+ constraint not met\."
check_log "Timing constraints are not met\."
'';
};
in pkgs.buildEnv rec {
inherit name;
paths = [ boardModule gateware ];
pathsToLink = [ "/${installPath}" ];
}

View File

@ -1,18 +0,0 @@
[
"python >=3.5.3,<3.6"
"llvmlite-artiq 0.23.0.dev py35_5"
"binutils-or1k-linux >=2.27"
"pythonparser >=1.1"
"openocd 0.10.0 6"
"scipy"
"numpy"
"prettytable"
"h5py 2.8"
"python-dateutil"
"pyqt >=5.5"
"quamash"
"pyqtgraph 0.10.0"
"pygit2"
"python-levenshtein"
"sipyco"
]

View File

@ -1,23 +0,0 @@
{ pkgs }:
let
version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
fakeCondaSource = import ./conda-fake-source.nix { inherit pkgs; } {
name = "artiq";
inherit version;
src = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
dependencies = import ./conda-artiq-deps.nix;
extraYaml =
''
about:
home: https://m-labs.hk/artiq
license: LGPL
summary: 'A leading-edge control system for quantum information experiments'
'';
};
conda-artiq = import ./conda-build.nix { inherit pkgs; } {
name = "conda-artiq";
src = fakeCondaSource;
};
in
conda-artiq

View File

@ -0,0 +1,11 @@
--- a/intl/relocatable.c 2018-02-28 18:19:46.318224392 +0000
+++ b/intl/relocatable.c 2018-02-28 18:19:37.614224749 +0000
@@ -145,7 +145,7 @@
libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
#endif
#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
- libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
+ // libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
#endif
#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);

View File

@ -0,0 +1,21 @@
set MSYS=C:\MSYS64
set TRIPLE=x86_64-pc-mingw64
set PATH=%MSYS%\usr\bin;%MSYS%\mingw64\bin;%PATH%
mkdir build
cd build
set CFLAGS=-I%PREFIX:\=/%/Library/include/
set LDFLAGS=-L%PREFIX:\=/%/Library/lib/
sh ../configure --build=%TRIPLE% ^
--prefix="%PREFIX:\=/%/Library" ^
--target=##TARGET##
if errorlevel 1 exit 1
make -j4
if errorlevel 1 exit 1
make install
if errorlevel 1 exit 1
rem this is a copy of prefixed executables
rmdir /S /Q %PREFIX%\Library\##TARGET##

View File

@ -0,0 +1,17 @@
package:
name: binutils-##TARGET##
version: ##VERSION##
source:
url: ../src.tar.bz2
requirements:
build:
- libiconv
run:
- libiconv
about:
home: https://www.gnu.org/software/binutils/
license: GPL
summary: 'A set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code.'

View File

@ -0,0 +1,54 @@
{ pkgs, version, src, target }:
let
wfvm = import ../wfvm.nix { inherit pkgs; };
libiconv-filename = "libiconv-1.15-h1df5818_7.tar.bz2";
libiconv = pkgs.fetchurl {
url = "https://anaconda.org/anaconda/libiconv/1.15/download/win-64/${libiconv-filename}";
sha256 = "0p431madykrjmi9sbl2sy9kzb0l3vhgs677i8q7cx8g210ab5g52";
};
vc14-filename = "vc-14.1-h0510ff6_4.tar.bz2";
vc14 = pkgs.fetchurl {
url = "https://anaconda.org/anaconda/vc/14.1/download/win-64/${vc14-filename}";
sha256 = "0nsyxph667x8ky1nybakpnk816dkrzbf1684jd7pp6wm5x73p34v";
};
vs2015_runtime-filename = "vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
vs2015_runtime = pkgs.fetchurl {
url = "https://anaconda.org/anaconda/vs2015_runtime/14.16.27012/download/win-64/${vs2015_runtime-filename}";
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
};
build = wfvm.utils.wfvm-run {
name = "build-binutils";
image = wfvm.makeWindowsImage { installCommands = with wfvm.layers; [ anaconda3 msys2 (msys2-packages (import ./msys_packages.nix { inherit pkgs; } )) ]; };
script = ''
# Create a fake channel to work around another pile of bugs and cretinous design decisions from conda.
${wfvm.utils.win-exec}/bin/win-exec "mkdir fake-channel && mkdir fake-channel\win-64"
ln -s ${libiconv} ${libiconv-filename}
${wfvm.utils.win-put}/bin/win-put ${libiconv-filename} ./fake-channel/win-64
ln -s ${vc14} ${vc14-filename}
${wfvm.utils.win-put}/bin/win-put ${vc14-filename} ./fake-channel/win-64
ln -s ${vs2015_runtime} ${vs2015_runtime-filename}
${wfvm.utils.win-put}/bin/win-put ${vs2015_runtime-filename} ./fake-channel/win-64
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
cp --no-preserve=mode,ownership -R ${./binutils-recipe} binutils
sed -i s/##TARGET##/${target}/g binutils/*
sed -i s/##VERSION##/${version}/g binutils/*
${wfvm.utils.win-put}/bin/win-put binutils .
tar xjf ${src}
patch -d binutils-${version} -p1 < ${./binutils-hack-libiconv.patch}
tar cjf src.tar.bz2 binutils-${version}
${wfvm.utils.win-put}/bin/win-put src.tar.bz2 .
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda build --no-anaconda-upload --no-test -c file:///C:/users/wfvm/fake-channel --override-channels binutils"
${wfvm.utils.win-get}/bin/win-get "Anaconda3/conda-bld/win-64/binutils-${target}-${version}-0.tar.bz2"
'';
};
in
pkgs.runCommand "conda-windows-binutils-${target}" { buildInputs = [ build ]; } ''
wfvm-run-build-binutils
mkdir -p $out/win-64 $out/nix-support
cp binutils-*.tar.bz2 $out/win-64
echo file conda $out/win-64/*.tar.bz2 >> $out/nix-support/hydra-build-products
''

View File

@ -0,0 +1,83 @@
{ pkgs, version, src }:
let
wfvm = import ../wfvm.nix { inherit pkgs; };
conda-vs2015_runtime-filename = "vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
conda-vs2015_runtime = pkgs.fetchurl {
url = "https://anaconda.org/anaconda/vs2015_runtime/14.16.27012/download/win-64/${conda-vs2015_runtime-filename}";
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
};
conda-cmake-filename = "cmake-3.17.2-h33f27b4_0.tar.bz2";
conda-cmake = pkgs.fetchurl {
url = "https://anaconda.org/anaconda/cmake/3.17.2/download/win-64/${conda-cmake-filename}";
sha256 = "0lg782pj2i9h20rwfkwwskis038r98b3z4c9j1a6ih95rc6m2acn";
};
build = wfvm.utils.wfvm-run {
name = "build-llvm-or1k";
image = wfvm.makeWindowsImage { installCommands = with wfvm.layers; [ anaconda3 msvc msvc-ide-unbreak ]; };
script = ''
# Create a fake channel so that the conda garbage doesn't complain about not finding the packages it just installed.
ln -s ${conda-vs2015_runtime} ${conda-vs2015_runtime-filename}
ln -s ${conda-cmake} ${conda-cmake-filename}
${wfvm.utils.win-exec}/bin/win-exec "mkdir fake-channel && mkdir fake-channel\win-64"
${wfvm.utils.win-put}/bin/win-put ${conda-vs2015_runtime-filename} ./fake-channel/win-64
${wfvm.utils.win-put}/bin/win-put ${conda-cmake-filename} ./fake-channel/win-64
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
cat > meta.yaml << EOF
package:
name: llvm-or1k
version: ${version}
source:
url: ../src.tar
requirements:
build:
- cmake
EOF
cat > bld.bat << EOF
set BUILD_TYPE=Release
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
mkdir build
cd build
cmake .. -G "%CMAKE_GENERATOR%" ^
-Thost=x64 ^
-DCMAKE_BUILD_TYPE="%BUILD_TYPE%" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DLLVM_BUILD_LLVM_DYLIB=ON ^
-DLLVM_TARGETS_TO_BUILD=X86;ARM ^
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=OR1K ^
-DLLVM_ENABLE_ASSERTIONS=OFF ^
-DLLVM_INSTALL_UTILS=ON ^
-DLLVM_INCLUDE_TESTS=OFF ^
-DLLVM_INCLUDE_DOCS=OFF ^
-DLLVM_INCLUDE_EXAMPLES=OFF
if errorlevel 1 exit 1
cmake --build . --config "%BUILD_TYPE%" --parallel 4
if errorlevel 1 exit 1
cmake --build . --config "%BUILD_TYPE%" --target install
if errorlevel 1 exit 1
EOF
${wfvm.utils.win-exec}/bin/win-exec "mkdir llvm-or1k"
${wfvm.utils.win-put}/bin/win-put meta.yaml llvm-or1k
${wfvm.utils.win-put}/bin/win-put bld.bat llvm-or1k
ln -s ${src} src
tar chf src.tar src
${wfvm.utils.win-put}/bin/win-put src.tar .
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda build --no-anaconda-upload --no-test -c file:///C:/users/wfvm/fake-channel --override-channels llvm-or1k"
${wfvm.utils.win-get}/bin/win-get "Anaconda3/conda-bld/win-64/llvm-or1k-${version}-0.tar.bz2"
'';
};
in
pkgs.runCommand "conda-windows-llvm-or1k" { buildInputs = [ build ]; } ''
wfvm-run-build-llvm-or1k
mkdir -p $out/win-64 $out/nix-support
cp llvm-or1k-*.tar.bz2 $out/win-64
echo file conda $out/win-64/*.tar.bz2 >> $out/nix-support/hydra-build-products
''

View File

@ -0,0 +1,74 @@
{ pkgs, conda-windows-llvm-or1k, version, src }:
let
wfvm = import ../wfvm.nix { inherit pkgs; };
conda-vs2015_runtime-filename = "vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
conda-vs2015_runtime = pkgs.fetchurl {
url = "https://anaconda.org/anaconda/vs2015_runtime/14.16.27012/download/win-64/${conda-vs2015_runtime-filename}";
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
};
conda-cmake-filename = "cmake-3.17.2-h33f27b4_0.tar.bz2";
conda-cmake = pkgs.fetchurl {
url = "https://anaconda.org/anaconda/cmake/3.17.2/download/win-64/${conda-cmake-filename}";
sha256 = "0lg782pj2i9h20rwfkwwskis038r98b3z4c9j1a6ih95rc6m2acn";
};
build = wfvm.utils.wfvm-run {
name = "build-llvmlite-artiq";
image = wfvm.makeWindowsImage { installCommands = with wfvm.layers; [ anaconda3 msvc msvc-ide-unbreak ]; };
script = ''
ln -s ${conda-vs2015_runtime} ${conda-vs2015_runtime-filename}
ln -s ${conda-cmake} ${conda-cmake-filename}
${wfvm.utils.win-exec}/bin/win-exec "mkdir fake-channel && mkdir fake-channel\win-64"
${wfvm.utils.win-put}/bin/win-put ${conda-vs2015_runtime-filename} ./fake-channel/win-64
${wfvm.utils.win-put}/bin/win-put ${conda-cmake-filename} ./fake-channel/win-64
${wfvm.utils.win-put}/bin/win-put ${conda-windows-llvm-or1k}/win-64/llvm-or1k-*.tar.bz2 ./fake-channel/win-64
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
cat > meta.yaml << EOF
package:
name: llvmlite-artiq
version: ${version}
source:
url: ../src.tar
requirements:
build:
- cmake
- llvm-or1k
EOF
cat > bld.bat << EOF
@rem Let CMake know about the LLVM install path, for find_package()
set CMAKE_PREFIX_PATH=%LIBRARY_PREFIX%
@rem Ensure there are no build leftovers (CMake can complain)
if exist ffi\build rmdir /S /Q ffi\build
python setup.py install \
--prefix=%PREFIX% \
--single-version-externally-managed \
--record=record.txt \
--no-compile
if errorlevel 1 exit 1
EOF
${wfvm.utils.win-exec}/bin/win-exec "mkdir llvmlite-artiq"
${wfvm.utils.win-put}/bin/win-put meta.yaml llvmlite-artiq
${wfvm.utils.win-put}/bin/win-put bld.bat llvmlite-artiq
ln -s ${src} src
tar chf src.tar src
${wfvm.utils.win-put}/bin/win-put src.tar .
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda build --no-anaconda-upload --no-test -c file:///C:/users/wfvm/fake-channel --override-channels llvmlite-artiq"
${wfvm.utils.win-get}/bin/win-get "Anaconda3/conda-bld/win-64/llvmlite-artiq-${version}-0.tar.bz2"
'';
};
in
pkgs.runCommand "conda-windows-llvmlite-artiq" { buildInputs = [ build ]; } ''
wfvm-run-build-llvmlite-artiq
mkdir -p $out/win-64 $out/nix-support
cp llvmlite-artiq-*.tar.bz2 $out/win-64
echo file conda $out/win-64/*.tar.bz2 >> $out/nix-support/hydra-build-products
''

View File

@ -0,0 +1,177 @@
{ pkgs } : [
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-1-any.pkg.tar.xz";
sha256 = "0w8jkjr5gwybw9469216vs6vpibkq36wx47bbl4r0smi4wvh2yxk";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-7-any.pkg.tar.xz";
sha256 = "1hnfagn5m0ys4f8349d8dpbqvh9p900jjn83r7fi1az6i9dz1v0x";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.34-3-any.pkg.tar.zst";
sha256 = "0ahlwbg5ir89nbra407yrzsplib4cia9m0dggcqjw1i4bxi7ypj1";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-headers-git-8.0.0.5905.066f1b3c-1-any.pkg.tar.zst";
sha256 = "0sskg0vvgggs932i09ipm5rrllv6vdf1ai3d3fvbi5pxis1xc9g0";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-crt-git-8.0.0.5905.066f1b3c-1-any.pkg.tar.zst";
sha256 = "1sjizkvknivbjs962fqxcmjkgnrvhd1frq96cfj2fyzk5cz7kfx0";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-isl-0.22.1-1-any.pkg.tar.xz";
sha256 = "1nj7sj3hgxhziqs1l7k42ginl10w7iy1b753mwvqiczfs322hb90";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz";
sha256 = "1l4qdxr8xp6xyxabwcf9b876db3rhj4v54zsvb4v1kwm3jrs7caw";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.0.2-2-any.pkg.tar.xz";
sha256 = "0hriryx58bkk3sihnhd4i6966civ3hq8i68rnc9kjivk47wi49rj";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz";
sha256 = "0x1kg178l6mf9ivdy71bci36h2a37vypg4jk3k7y31ks6i79zifp";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst";
sha256 = "16aqi04drn252cxdh1brpbi4syn4bfjb84qk4xqbnffnpxpvv5ph";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.1.0-3-any.pkg.tar.zst";
sha256 = "0bmkrb9x7z0azzxl3z08r6chcl0pbnaijar7cdjxb2nh7fbbdzzp";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz";
sha256 = "1kwxb3q2slgsg17lkd0dc9fjks5f205dgm79fj0xq0zmrsns83kc";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst";
sha256 = "17nq8gs1nnxgligdrp5n6h4pnk46xw0yhjk2hn6y12vvpn7iv05v";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zstd-1.4.5-1-any.pkg.tar.zst";
sha256 = "1jfxzajmbvlap1c0v17s8dzwdx0fi8kyrkmgr6gw1snisgllifyh";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.1.0-3-any.pkg.tar.zst";
sha256 = "1gkcc6hh20glx4b96ldsnd70r8dbp460bxfznm9z2rwgr0mxb374";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/make-4.3-1-x86_64.pkg.tar.xz";
sha256 = "0bmgggw56gkx7dcd8simpi2lhgz98limikx8wm0cb8cn7awi9w82";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/m4-1.4.18-2-x86_64.pkg.tar.xz";
sha256 = "05x7myqwwxk3vfqmliwk5pfn0w04fnjh1sqafsynpb9hx0c563ji";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/diffutils-3.7-1-x86_64.pkg.tar.xz";
sha256 = "11qdxn4mr8a96palhp5jkam904fh77bsw5v7mslhnzag4cg3kybx";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/autoconf-2.69-5-any.pkg.tar.xz";
sha256 = "1fxvgbjnmmb7dvmssfxkiw151dfd1wzj04hf45zklmzs4h2kkwda";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.6-1.6.3-2-any.pkg.tar.xz";
sha256 = "0if4wrr1vm2f1zjjh6dpln97xc1l1052bcawzmndwfh561cfxqb6";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.7-1.7.9-2-any.pkg.tar.xz";
sha256 = "1mjhp1k4c0xm8hfm3yckqvfb4ablzgg8a87l7wxaq1mmmskjmhpq";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.8-1.8.5-3-any.pkg.tar.xz";
sha256 = "046bzr44ss0lglx9lzccj9li74arz632hyvz6l9fcp98dndr3qjk";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.9-1.9.6-2-any.pkg.tar.xz";
sha256 = "0bh0dldmrd46xhix5358nj9sgf298n4ap0y8dsl6rvjsb5c0l5hd";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.10-1.10.3-3-any.pkg.tar.xz";
sha256 = "0p26lkx5n1mmmw1y98bgwzbxfxkfa18fqxvkgsm60fznjig4dq61";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.11-1.11.6-3-any.pkg.tar.xz";
sha256 = "1cjkav2bskf9rdm8g3hsl2l7wz1lx8dfigwqib0xhm7n8i8gc560";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.12-1.12.6-3-any.pkg.tar.xz";
sha256 = "1c0h2lngfjjfvw0jkrfah1fs25k0vdm80hlxfjs912almh2yg5gv";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.13-1.13.4-4-any.pkg.tar.xz";
sha256 = "0mczn8hanqn3hxr104klb832b4cnzn44bbn7lvqfsbvvjpklv9ld";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.14-1.14.1-3-any.pkg.tar.xz";
sha256 = "04gjyfszyphxy7qc1rr8378ms9hql0sy8a1gyj0mvpbmgb0phgkp";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.15-1.15.1-1-any.pkg.tar.xz";
sha256 = "00n1f3c6fwznpm1f6xmj30q41ixw5vdg52yg48yvr4jswb78qf8q";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake1.16-1.16.1-1-any.pkg.tar.xz";
sha256 = "1ds8rpagrlkzi28n5rh0jcibbic49xssl2hz6sy41my0vd8a3z9y";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/automake-wrapper-11-1-any.pkg.tar.xz";
sha256 = "1dzymv59wri7qqmgmy5xfkq6zvfcb0znwspc149a04d0bhxs75gw";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/libltdl-2.4.6-9-x86_64.pkg.tar.xz";
sha256 = "0j0xazjpj28dib9vjn3paibhry77k903rzvbkdn6gnl20smj18g2";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/tar-1.32-1-x86_64.pkg.tar.xz";
sha256 = "0ynz2qwzbcmixcxddp05q2wc7iqli6svzkrjss9izrpmbkv5ifa5";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz";
sha256 = "0mrnkayrhmrgq446nyysvj3kadqm1xhyl97qqv6hrq57lhkcry2p";
})
(pkgs.fetchurl {
url = "http://repo.msys2.org/msys/x86_64/texinfo-6.7-1-x86_64.pkg.tar.xz";
sha256 = "0c50809yg9g95m8yib867q8m28sjabqppz2qbzh3gr83z55kknnw";
})
]

View File

@ -0,0 +1,13 @@
{ pkgs, name, filename, baseurl, sha256 }:
let
download = pkgs.fetchurl {
url = "${baseurl}${filename}";
inherit sha256;
};
in
pkgs.runCommand "conda-windows-${name}" { } ''
mkdir -p $out/win-64 $out/nix-support
ln -s ${download} $out/win-64/${filename}
echo file conda $out/win-64/${filename} >> $out/nix-support/hydra-build-products
''

View File

@ -0,0 +1,16 @@
[
"llvmlite-artiq"
"binutils-or1k-linux"
"pythonparser"
"scipy"
"numpy"
"prettytable"
"h5py"
"python-dateutil"
"pyqt"
"quamash"
"pyqtgraph"
"pygit2"
"python-levenshtein"
"sipyco"
]

View File

@ -0,0 +1,23 @@
{ pkgs }:
let
version = import ../pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
fakeCondaSource = import ./fake-source.nix { inherit pkgs; } {
name = "artiq";
inherit version;
src = import ../pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
dependencies = import ./artiq-deps.nix;
extraYaml =
''
about:
home: https://m-labs.hk/artiq
license: LGPL
summary: 'A leading-edge control system for quantum information experiments'
'';
};
conda-artiq = import ./build.nix { inherit pkgs; } {
name = "conda-artiq";
src = fakeCondaSource;
};
in
conda-artiq

View File

@ -0,0 +1,45 @@
{ pkgs, version, src, target }:
let
fake-src = pkgs.runCommand "conda-fake-source-binutils-${target}" { }
''
mkdir -p $out/fake-conda;
cat << EOF > $out/fake-conda/meta.yaml
package:
name: binutils-${target}
version: ${version}
source:
url: ${src}
# Note: libiconv is also a build dependency, but the conda garbage won't find it
# if installed from a file (even if it shows up in conda list), as is the case
# when using this script.
requirements:
run:
- libiconv
EOF
cat << EOF > $out/fake-conda/build.sh
#!/bin/bash
set -e
mkdir build
cd build
../configure --target=${target} --prefix=\$PREFIX
make
make install
# this is a copy of prefixed executables
rm -rf $PREFIX/${target}
EOF
chmod 755 $out/fake-conda/build.sh
'';
in
import ./build.nix { inherit pkgs; } {
name = "conda-binutils-${target}";
src = fake-src;
}

View File

@ -0,0 +1,36 @@
{ pkgs, bscan_spi_bitstreams }:
let
src = pkgs.runCommand "conda-fake-source-bscan_spi_bitstreams" { }
''
mkdir -p $out/fake-conda;
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
cp --no-preserve=mode,ownership -R ${bscan_spi_bitstreams} workaround-conda
pushd workaround-conda
tar cf $out/src.tar .
popd
rm -rf workaround-conda
cat << EOF > $out/fake-conda/meta.yaml
package:
name: bscan-spi-bitstreams
version: "0.10.0"
source:
url: ../src.tar
build:
noarch: generic
binary_relocation: false
script:
- "mkdir -p \$PREFIX/share/bscan-spi-bitstreams"
- "cp *.bit \$PREFIX/share/bscan-spi-bitstreams"
EOF
'';
in
import ./build.nix { inherit pkgs; } {
name = "conda-bscan_spi_bitstreams";
inherit src;
}

View File

@ -5,16 +5,16 @@
{ name, src, recipe ? "fake-conda"}: { name, src, recipe ? "fake-conda"}:
let let
condaBuilderEnv = import ./conda-builder-env.nix { inherit pkgs; }; condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
in pkgs.stdenv.mkDerivation { in pkgs.stdenv.mkDerivation {
inherit name src; inherit name src;
buildCommand = buildCommand =
'' ''
HOME=`pwd` HOME=`pwd`
mkdir $out mkdir $out
${condaBuilderEnv}/bin/conda-builder-env -c "PYTHON=python conda build --no-anaconda-upload --no-test --output-folder $out $src/${recipe}" ${condaBuilderEnv}/bin/conda-builder-env -c "conda build --no-anaconda-upload --no-test --output-folder $out $src/${recipe}"
mkdir -p $out/nix-support mkdir -p $out/nix-support
echo file conda $out/noarch/*.tar.bz2 >> $out/nix-support/hydra-build-products echo file conda $out/*/*.tar.bz2 >> $out/nix-support/hydra-build-products
''; '';
} }

View File

@ -3,7 +3,7 @@
with pkgs; with pkgs;
let let
condaDeps = [ stdenv.cc xorg.libSM xorg.libICE xorg.libXrender libselinux ]; condaDeps = [ stdenv.cc xorg.libSM xorg.libICE xorg.libX11 xorg.libXau xorg.libXi xorg.libXrender libselinux libGL ];
# Use the full Anaconda distribution, which already contains conda-build and its many dependencies, # Use the full Anaconda distribution, which already contains conda-build and its many dependencies,
# so we don't have to manually deal with them. # so we don't have to manually deal with them.
condaInstaller = fetchurl { condaInstaller = fetchurl {
@ -16,14 +16,32 @@ let
targetPkgs = pkgs: ([ condaSrcChmod ] ++ condaDeps); targetPkgs = pkgs: ([ condaSrcChmod ] ++ condaDeps);
}; };
# for binutils
libiconv-filename = "libiconv-1.15-h516909a_1006.tar.bz2";
libiconv = pkgs.fetchurl {
url = "https://anaconda.org/conda-forge/libiconv/1.15/download/linux-64/${libiconv-filename}";
sha256 = "1y1g807881j95f9s6mjinf6b7mqa51vc9jf0v7cx8hn7xx4d10ik";
};
condaInstalled = runCommand "conda-installed" { } condaInstalled = runCommand "conda-installed" { }
'' ''
${condaInstallerEnv}/bin/conda-installer-env -c "${condaSrcChmod}/conda-installer.sh -p $out -b" ${condaInstallerEnv}/bin/conda-installer-env -c "${condaSrcChmod}/conda-installer.sh -p $out -b"
substituteInPlace $out/lib/python3.7/site-packages/conda/gateways/disk/__init__.py \ substituteInPlace $out/lib/python3.7/site-packages/conda/gateways/disk/__init__.py \
--replace "os.chmod(path, 0o2775)" "pass" --replace "os.chmod(path, 0o2775)" "pass"
# The conda garbage breaks if the package filename is prefixed with the Nix store hash.
# Symptom is "WARNING conda.core.prefix_data:_load_single_record(167): Ignoring malformed
# prefix record at: /nix/store/[...].json", and the package is not registered in the conda
# list, even though its files are installed.
ln -s ${libiconv} ${libiconv-filename}
${condaInstallerEnv}/bin/conda-installer-env -c "$out/bin/conda install ${libiconv-filename}"
''; '';
in in
buildFHSUserEnv { buildFHSUserEnv {
name = "conda-builder-env"; name = "conda-builder-env";
targetPkgs = pkgs: [ condaInstalled ] ++ condaDeps; targetPkgs = pkgs: ([ condaInstalled ] ++ condaDeps ++ [
# for llvm-or1k
cmake
]
);
} }

View File

@ -1,5 +1,5 @@
{ pkgs }: { pkgs }:
{ name, version, src, dependencies ? [], extraYaml ? ""}: { name, version, src, extraSrcCommands ? "", dependencies ? [], extraYaml ? ""}:
pkgs.runCommand "conda-fake-source-${name}" { } pkgs.runCommand "conda-fake-source-${name}" { }
'' ''
mkdir -p $out/fake-conda; mkdir -p $out/fake-conda;
@ -7,6 +7,7 @@ pkgs.runCommand "conda-fake-source-${name}" { }
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files. # work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
cp --no-preserve=mode,ownership -R ${src} workaround-conda cp --no-preserve=mode,ownership -R ${src} workaround-conda
pushd workaround-conda pushd workaround-conda
${extraSrcCommands}
tar cf $out/src.tar . tar cf $out/src.tar .
popd popd
rm -rf workaround-conda rm -rf workaround-conda
@ -44,6 +45,7 @@ pkgs.runCommand "conda-fake-source-${name}" { }
set -e set -e
export VERSIONEER_OVERRIDE=${version} export VERSIONEER_OVERRIDE=${version}
export LD_LIBRARY_PATH=/lib
python setup.py install \ python setup.py install \
--prefix=\$PREFIX \ --prefix=\$PREFIX \
--single-version-externally-managed \ --single-version-externally-managed \

View File

@ -0,0 +1,52 @@
{ pkgs, version, src }:
let
fake-src = pkgs.runCommand "conda-fake-source-llvm-or1k" { }
''
mkdir -p $out/fake-conda;
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
cp --no-preserve=mode,ownership -R ${src} workaround-conda
pushd workaround-conda
tar cf $out/src.tar .
popd
rm -rf workaround-conda
cat << EOF > $out/fake-conda/meta.yaml
package:
name: llvm-or1k
version: ${version}
# Use the nixpkgs cmake to build, so we are less bothered by conda idiocy.
source:
url: ../src.tar
EOF
cat << EOF > $out/fake-conda/build.sh
mkdir build
cd build
cmake .. \$COMPILER32 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=\$PREFIX \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD=X86\;ARM \
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=OR1K \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF
make -j2
make install
EOF
chmod 755 $out/fake-conda/build.sh
'';
in
import ./build.nix { inherit pkgs; } {
name = "conda-llvm-or1k";
src = fake-src;
}

View File

@ -0,0 +1,69 @@
{ pkgs, conda-llvm-or1k, version, src }:
let
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
fake-src = pkgs.runCommand "conda-fake-source-llvmlite-artiq" { }
''
mkdir -p $out/fake-conda;
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
cp --no-preserve=mode,ownership -R ${src} workaround-conda
pushd workaround-conda
tar cf $out/src.tar .
popd
rm -rf workaround-conda
cat << EOF > $out/fake-conda/meta.yaml
package:
name: llvmlite-artiq
version: ${version}
source:
url: ../src.tar
# Again, we don't specify build dependencies since the conda garbage mistakenly thinks
# that they are not there if they have been installed from files.
requirements:
run:
- python
- ncurses [linux]
EOF
cat << EOF > $out/fake-conda/build.sh
#!/bin/bash
set -e
export LD_LIBRARY_PATH=/lib
python setup.py install \
--prefix=\$PREFIX \
--single-version-externally-managed \
--record=record.txt \
--no-compile
EOF
chmod 755 $out/fake-conda/build.sh
'';
in
pkgs.stdenv.mkDerivation {
name = "conda-llvmlite-artiq";
src = fake-src;
buildCommand =
''
HOME=`pwd`
mkdir $out
cat << EOF > conda-commands.sh
set -e
conda create --prefix ./conda_tmp ${conda-llvm-or1k}/*/*.tar.bz2
conda init
source .bashrc
conda activate ./conda_tmp
conda build --no-anaconda-upload --no-test --output-folder $out $src/fake-conda
EOF
${condaBuilderEnv}/bin/conda-builder-env conda-commands.sh
mkdir -p $out/nix-support
echo file conda $out/*/*.tar.bz2 >> $out/nix-support/hydra-build-products
'';
}

View File

@ -17,29 +17,134 @@ let
start // { start // {
"artiq-board-${board.target}-${board.variant}" = boardBinaries; "artiq-board-${board.target}-${board.variant}" = boardBinaries;
}) {} boards; }) {} boards;
mainPackages = rec { mainPackages = rec {
inherit (pythonDeps) sipyco asyncserial levenshtein pythonparser quamash pyqtgraph-qt5 misoc migen microscope jesd204b migen-axi lit outputcheck; inherit (pythonDeps) sipyco asyncserial pythonparser pyqtgraph-qt5 misoc migen microscope jesd204b migen-axi lit outputcheck;
binutils-or1k = callPackage ./pkgs/binutils.nix { platform = "or1k"; target = "or1k-linux"; }; binutils-or1k = callPackage ./pkgs/binutils.nix { platform = "or1k"; target = "or1k-linux"; };
binutils-arm = callPackage ./pkgs/binutils.nix { platform = "arm"; target = "armv7-unknown-linux-gnueabihf"; }; binutils-arm = callPackage ./pkgs/binutils.nix { platform = "arm"; target = "armv7-unknown-linux-gnueabihf"; };
llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {}; llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {};
rustc = callPackage ./pkgs/rust rustc = callPackage ./pkgs/rust/rustc-with-crates.nix
((stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) { ((stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4' stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
}) // }) //
{ inherit llvm-or1k; }); { inherit llvm-or1k; });
cargo = callPackage ./pkgs/rust/cargo.nix { inherit rustc; };
cargo-vendor = callPackage ./pkgs/rust/cargo-vendor.nix {};
llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; }; llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; };
libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; }; libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; };
artiq = callPackage ./pkgs/artiq.nix { inherit binutils-or1k llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; }; artiq = callPackage ./pkgs/artiq.nix { inherit binutils-or1k binutils-arm llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; };
artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; }); artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; });
openocd = callPackage ./pkgs/openocd.nix {}; openocd = callPackage ./pkgs/openocd.nix {};
conda-sipyco = import ./conda-build.nix { inherit pkgs; } { };
condaNoarch = {
conda-pythonparser = import ./conda/build.nix { inherit pkgs; } {
name = "conda-pythonparser";
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "pythonparser";
inherit (pythonDeps.pythonparser) version src;
extraSrcCommands = "patch -p1 < ${./pkgs/python37hack.patch}";
dependencies = ["regex"];
};
};
conda-sipyco = import ./conda/build.nix { inherit pkgs; } {
name = "conda-sipyco"; name = "conda-sipyco";
src = import ./conda-fake-source.nix { inherit pkgs; } { src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "sipyco"; name = "sipyco";
inherit (pythonDeps.sipyco) version src; inherit (pythonDeps.sipyco) version src;
dependencies = ["numpy"];
}; };
}; };
conda-artiq = import ./conda-artiq.nix { inherit pkgs; }; conda-quamash = import ./conda/build.nix { inherit pkgs; } {
name = "conda-quamash";
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "quamash";
inherit (pkgs.python3Packages.quamash) version src;
}; };
};
conda-bscan-spi-bitstreams = import ./conda/bscan-spi-bitstreams.nix {
inherit pkgs;
inherit (mainPackages.openocd) bscan_spi_bitstreams;
};
conda-artiq = import ./conda/artiq.nix { inherit pkgs; };
conda-asyncserial = import ./conda/build.nix { inherit pkgs; } {
name = "conda-asyncserial";
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "asyncserial";
inherit (pythonDeps.asyncserial) version src;
dependencies = ["pyserial"];
};
};
};
condaLinux = rec {
conda-binutils-or1k = import ./conda/binutils.nix {
inherit pkgs;
inherit (mainPackages.binutils-or1k) version src;
target = "or1k-linux";
};
conda-binutils-arm = import ./conda/binutils.nix {
inherit pkgs;
inherit (mainPackages.binutils-arm) version src;
target = "armv7-unknown-linux-gnueabihf";
};
conda-llvm-or1k = import ./conda/llvm-or1k.nix {
inherit pkgs;
inherit (mainPackages.llvm-or1k) version;
src = mainPackages.llvm-or1k.llvm-src;
};
conda-llvmlite-artiq = import ./conda/llvmlite-artiq.nix {
inherit pkgs conda-llvm-or1k;
inherit (mainPackages.llvmlite-artiq) version src;
};
};
condaWindowsLegacy = {
conda-windows-binutils-or1k = import ./conda-windows/redistribute.nix {
inherit pkgs;
name = "binutils-or1k";
filename = "binutils-or1k-linux-2.27-h93a10e1_6.tar.bz2";
baseurl = "https://anaconda.org/m-labs/binutils-or1k-linux/2.27/download/win-64/";
sha256 = "0gbks36hfsx3893mihj0bdmg5vwccrq5fw8xp9b9xb8p5pr8qhzx";
};
conda-windows-llvm-or1k = import ./conda-windows/redistribute.nix {
inherit pkgs;
name = "llvm-or1k";
filename = "llvm-or1k-6.0.0-25.tar.bz2";
baseurl = "https://anaconda.org/m-labs/llvm-or1k/6.0.0/download/win-64/";
sha256 = "06mnrg79rn9ni0d5z0x3jzb300nhqhbc2h9qbq5m50x3sgm8km63";
};
conda-windows-llvmlite-artiq = import ./conda-windows/redistribute.nix {
inherit pkgs;
name = "llvmlite-artiq";
filename = "llvmlite-artiq-0.23.0.dev-py35_5.tar.bz2";
baseurl = "https://anaconda.org/m-labs/llvmlite-artiq/0.23.0.dev/download/win-64/";
sha256 = "10w24w5ljvan06pbvwqj4pzal072jnyynmwm42dn06pq88ryz9wj";
};
};
condaWindowsExperimental = rec {
conda-windows-binutils-or1k = import ./conda-windows/binutils.nix {
inherit pkgs;
inherit (mainPackages.binutils-or1k) version src;
target = "or1k-linux";
};
conda-windows-binutils-arm = import ./conda-windows/binutils.nix {
inherit pkgs;
inherit (mainPackages.binutils-or1k) version src;
target = "armv7-unknown-linux-gnueabihf";
};
conda-windows-llvm-or1k = import ./conda-windows/llvm-or1k.nix {
inherit pkgs;
inherit (mainPackages.llvm-or1k) version;
src = mainPackages.llvm-or1k.llvm-src;
};
conda-windows-llvmlite-artiq = import ./conda-windows/llvmlite-artiq.nix {
inherit pkgs conda-windows-llvm-or1k;
inherit (mainPackages.llvmlite-artiq) version src;
};
};
condaWindows = if (pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0") then condaWindowsExperimental else condaWindowsLegacy;
in in
mainPackages // boardPackages boardPackages // mainPackages // condaNoarch // condaLinux // condaWindows

View File

@ -1,4 +1,4 @@
{ stdenv, callPackage, fetchgit, git, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }: { stdenv, lib, callPackage, fetchgit, git, python3Packages, qt5Full, binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }:
let let
pythonDeps = callPackage ./python-deps.nix {}; pythonDeps = callPackage ./python-deps.nix {};
@ -9,8 +9,9 @@ in
src = import ./artiq-src.nix { inherit fetchgit; }; src = import ./artiq-src.nix { inherit fetchgit; };
preBuild = "export VERSIONEER_OVERRIDE=${version}"; preBuild = "export VERSIONEER_OVERRIDE=${version}";
propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq qt5Full ] propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq qt5Full ]
++ (with pythonDeps; [ sipyco levenshtein pyqtgraph-qt5 quamash pythonparser ]) ++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ])
++ (with python3Packages; [ pygit2 numpy dateutil scipy prettytable pyserial h5py pyqt5 ]); ++ (with pythonDeps; [ sipyco pyqtgraph-qt5 pythonparser ])
++ (with python3Packages; [ pygit2 numpy dateutil quamash scipy prettytable pyserial python-Levenshtein h5py pyqt5 ]);
checkInputs = [ binutils-or1k outputcheck ]; checkInputs = [ binutils-or1k outputcheck ];
checkPhase = checkPhase =
'' ''

View File

@ -2,12 +2,14 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libartiq-support-${version}"; name = "libartiq-support-${version}";
version = import ./artiq-version.nix { inherit stdenv fetchgit git; }; version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; }; src = import ./artiq-src.nix { inherit fetchgit; };
buildInputs = [ rustc ];
phases = [ "buildPhase" ]; phases = [ "buildPhase" ];
# keep in sync with artiq/test/lit/lit.cfg or remove build from the latter once we don't use buildbot/conda anymore
buildPhase = buildPhase =
'' ''
mkdir $out mkdir $out
${rustc}/bin/rustc ${src}/artiq/test/libartiq_support/lib.rs --out-dir $out -Cpanic=unwind -g rustc ${src}/artiq/test/libartiq_support/lib.rs --out-dir $out -Cpanic=unwind -g
''; '';
} }

View File

@ -5,10 +5,10 @@
let let
llvm-src = fetchFromGitHub { llvm-src = fetchFromGitHub {
rev = "527aa86b578da5dfb9cf4510b71f0f46a11249f7"; rev = "7746fe85489e92e1caffda18b9d7b2ae9e5da1a8";
owner = "m-labs"; owner = "m-labs";
repo = "llvm-or1k"; repo = "llvm-or1k";
sha256 = "0lmcg9xj66pf4mb6racipw67vm8kwm84dl861hyqnywd61kvhrwa"; sha256 = "0jqbb3k9r91swsyrdak8fzvs1qi451zy8dqmpqriaxk5g83ny5b7";
}; };
clang-src = fetchFromGitHub { clang-src = fetchFromGitHub {
rev = "9e996136d52ed506ed8f57ef8b13b0f0f735e6a3"; rev = "9e996136d52ed506ed8f57ef8b13b0f0f735e6a3";
@ -26,7 +26,9 @@ let
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "llvm-or1k"; name = "llvm-or1k";
passthru.llvm-src = llvm-src;
src = llvm-clang-src; src = llvm-clang-src;
version = "6.0.0";
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind; buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind;

View File

@ -1,6 +1,7 @@
{ stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }: { stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }:
python3Packages.buildPythonPackage rec { python3Packages.buildPythonPackage rec {
name = "llvmlite-artiq"; name = "llvmlite-artiq";
version = "0.23.0.dev";
src = fetchFromGitHub { src = fetchFromGitHub {
rev = "158f9d3a898dbf055ca513d69505df288c681fea"; rev = "158f9d3a898dbf055ca513d69505df288c681fea";
owner = "m-labs"; owner = "m-labs";

View File

@ -32,6 +32,7 @@ stdenv.mkDerivation rec {
"--enable-buspirate" "--enable-buspirate"
"--enable-sysfsgpio" "--enable-sysfsgpio"
"--enable-remote-bitbang" "--enable-remote-bitbang"
"--disable-werror"
]; ];
NIX_CFLAGS_COMPILE = [ NIX_CFLAGS_COMPILE = [

View File

@ -16,6 +16,7 @@ rec {
asyncserial = python3Packages.buildPythonPackage rec { asyncserial = python3Packages.buildPythonPackage rec {
name = "asyncserial"; name = "asyncserial";
version = "0.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "asyncserial"; repo = "asyncserial";
@ -25,18 +26,9 @@ rec {
propagatedBuildInputs = with python3Packages; [ pyserial ]; propagatedBuildInputs = with python3Packages; [ pyserial ];
}; };
levenshtein = python3Packages.buildPythonPackage rec {
name = "levenshtein";
src = fetchFromGitHub {
owner = "ztane";
repo = "python-Levenshtein";
rev = "854e61a05bb8b750e990add96df412cd5448b75e";
sha256 = "1yf21kg1g2ivm5a4dx1jra9k0c33np54d0hk5ymnfyc4f6pg386q";
};
};
pythonparser = python3Packages.buildPythonPackage rec { pythonparser = python3Packages.buildPythonPackage rec {
name = "pythonparser"; name = "pythonparser";
version = "1.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "pythonparser"; repo = "pythonparser";
@ -47,18 +39,6 @@ rec {
propagatedBuildInputs = with python3Packages; [ regex ]; propagatedBuildInputs = with python3Packages; [ regex ];
}; };
quamash = python3Packages.buildPythonPackage rec {
name = "quamash";
src = fetchFromGitHub {
owner = "harvimt";
repo = "quamash";
rev = "e513b30f137415c5e098602fa383e45debab85e7";
sha256 = "117rp9r4lz0kfz4dmmpa35hp6nhbh6b4xq0jmgvqm68g9hwdxmqa";
};
propagatedBuildInputs = with python3Packages; [ pyqt5 ];
doCheck = false;
};
pyqtgraph-qt5 = python3Packages.buildPythonPackage rec { pyqtgraph-qt5 = python3Packages.buildPythonPackage rec {
name = "pyqtgraph_qt5-${version}"; name = "pyqtgraph_qt5-${version}";
version = "0.10.0"; version = "0.10.0";
@ -72,20 +52,6 @@ rec {
propagatedBuildInputs = with python3Packages; [ scipy numpy pyqt5 pyopengl ]; propagatedBuildInputs = with python3Packages; [ scipy numpy pyqt5 pyopengl ];
}; };
# TODO: use python3Packages.pyftdi starting with NixOS 19.09 or later
# Upstream PR: https://github.com/NixOS/nixpkgs/pull/61256
pyftdi = python3Packages.buildPythonPackage rec {
name = "pyftdi";
src = fetchFromGitHub {
owner = "eblot";
repo = "pyftdi";
rev = "8e6f0bab6cff3eb60d2dbe578d0c5a2d1a9e135c";
sha256 = "0mw79fjnvswa0j3bzr0y906rz1vjbr8lwy0albgvsfr0ngwbajqy";
};
propagatedBuildInputs = with python3Packages; [ pyusb pyserial ];
};
# Development/firmware dependencies # Development/firmware dependencies
misoc = python3Packages.buildPythonPackage rec { misoc = python3Packages.buildPythonPackage rec {
name = "misoc"; name = "misoc";
@ -93,8 +59,8 @@ rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "misoc"; repo = "misoc";
rev = "e7f76c3ca302d9b1040bb818d7cd07a5c031c63b"; rev = "7e5fe8d38835175202dad2c51d37b20b76fd9e16";
sha256 = "1cdqjgbhgrnds8m0mrgd9phb8gqmhlv8v3ivrz1mvs7cb1bwl0pf"; sha256 = "0i8bppz7x2s45lx9n49c0r87pqps09z35yzc17amvx21qsplahxn";
fetchSubmodules = true; fetchSubmodules = true;
}; };
@ -117,8 +83,8 @@ rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "migen"; repo = "migen";
rev = "bee558c8cb04720fb695f63d3597f2aefa55e8e4"; rev = "b1b2b298b85a795239daad84c75be073ddc4f8bd";
sha256 = "17ncpyphvjbpma946yby3ws01v6xwp7vfcjg3a9q9xw7k26r3fpr"; sha256 = "1qy2ydk8xqqv92i992j1g71fbi185zd6s3kigzsf3169874dyh81";
}; };
propagatedBuildInputs = with python3Packages; [ colorama ]; propagatedBuildInputs = with python3Packages; [ colorama ];
@ -157,8 +123,8 @@ rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "jesd204b"; repo = "jesd204b";
rev = "2fd6391c0a9197580d60f7d8a146191dc7337b03"; rev = "ac877ac5975411a438415f824e182338ed773529";
sha256 = "1lhw8f0dp42xx4g6d7hyhqhrnd6i5ll4a1wcg265rqz3600i4009"; sha256 = "1lkb7cyj87bq4y0hp6379jq4q4lm2ijldccpyhawiizcfkawxa10";
}; };
propagatedBuildInputs = with python3Packages; [ migen misoc ]; propagatedBuildInputs = with python3Packages; [ migen misoc ];
@ -199,7 +165,7 @@ rec {
}; };
nativeBuildInputs = [ python3Packages.pbr ]; nativeBuildInputs = [ python3Packages.pbr ];
propagatedBuildInputs = [ fastnumbers ]; propagatedBuildInputs = [ python3Packages.future fastnumbers ];
checkInputs = [ python3Packages.pytest python3Packages.pytest-flake8 ]; checkInputs = [ python3Packages.pytest python3Packages.pytest-flake8 ];
checkPhase = "pytest"; checkPhase = "pytest";
@ -222,19 +188,24 @@ rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "peteut"; owner = "peteut";
repo = "migen-axi"; repo = "migen-axi";
rev = "8526eca769c01e18cc0a6024aacc515ceb8b9bd5"; rev = "c4002f7db62cb9c4599336a9413006ee1d138fbd";
sha256 = "19gycn7s32j7zzy064qj2yv9g9jk9kn9z3q0fap2dg308g6d1pjs"; sha256 = "0p2ndznch7z4sbp4m8hq49rkg7p4vcrlbbfk6l8644wyl1kk0fvg";
}; };
nativeBuildInputs = [ python3Packages.pbr ];
propagatedBuildInputs = [ python3Packages.click python3Packages.numpy python3Packages.toolz python3Packages.jinja2 ramda migen misoc ];
postPatch = '' postPatch = ''
substituteInPlace src/migen_axi/integration/soc_core.py \ substituteInPlace requirements.txt \
--replace "identifier_mem" "identifier" --replace "jinja2==2.10.3" "jinja2"
substituteInPlace tests/test_integration.py \ substituteInPlace requirements.txt \
--replace "zedboard.Platform(name=\"soc\", toolchain=\"vivado\")" "zedboard.Platform()" --replace "future==0.18.2" "future"
substituteInPlace requirements.txt \
--replace "ramda==0.5.5" "ramda"
substituteInPlace requirements.txt \
--replace "colorama==0.4.3" "colorama"
''; '';
nativeBuildInputs = [ python3Packages.pbr ];
propagatedBuildInputs = [ python3Packages.click python3Packages.numpy python3Packages.toolz ramda migen misoc ];
checkInputs = [ python3Packages.pytest python3Packages.pytest-flake8 ]; checkInputs = [ python3Packages.pytest python3Packages.pytest-flake8 ];
checkPhase = "pytest"; checkPhase = "pytest";

View File

@ -0,0 +1,693 @@
# Generated by carnix 0.10.0: carnix generate-nix --src .
{ lib, buildPlatform, buildRustCrate, buildRustCrateHelpers, cratesIO, fetchgit }:
with buildRustCrateHelpers;
let inherit (lib.lists) fold;
inherit (lib.attrsets) recursiveUpdate;
in
rec {
crates = cratesIO // rec {
# cargo-vendor-0.1.23
crates.cargo_vendor."0.1.23" = deps: { features?(features_.cargo_vendor."0.1.23" deps {}) }: buildRustCrate {
crateName = "cargo-vendor";
version = "0.1.23";
description = "A Cargo subcommand to vendor all crates.io dependencies onto the local\nfilesystem.\n";
authors = [ "Alex Crichton <alex@alexcrichton.com>" ];
edition = "2018";
src = exclude [ ".git" "target" ] ./.;
dependencies = mapFeatures features ([
(cratesIO.crates."cargo"."${deps."cargo_vendor"."0.1.23"."cargo"}" deps)
(cratesIO.crates."docopt"."${deps."cargo_vendor"."0.1.23"."docopt"}" deps)
(cratesIO.crates."env_logger"."${deps."cargo_vendor"."0.1.23"."env_logger"}" deps)
(cratesIO.crates."failure"."${deps."cargo_vendor"."0.1.23"."failure"}" deps)
(cratesIO.crates."serde"."${deps."cargo_vendor"."0.1.23"."serde"}" deps)
(cratesIO.crates."serde_json"."${deps."cargo_vendor"."0.1.23"."serde_json"}" deps)
(cratesIO.crates."toml"."${deps."cargo_vendor"."0.1.23"."toml"}" deps)
]
++ (if features.cargo_vendor."0.1.23".openssl or false then [ (cratesIO.crates.openssl."${deps."cargo_vendor"."0.1.23".openssl}" deps) ] else []));
features = mkFeatures (features."cargo_vendor"."0.1.23" or {});
};
features_.cargo_vendor."0.1.23" = deps: f: updateFeatures f (rec {
cargo."${deps.cargo_vendor."0.1.23".cargo}".default = true;
cargo_vendor."0.1.23".default = (f.cargo_vendor."0.1.23".default or true);
docopt."${deps.cargo_vendor."0.1.23".docopt}".default = true;
env_logger."${deps.cargo_vendor."0.1.23".env_logger}".default = true;
failure."${deps.cargo_vendor."0.1.23".failure}".default = true;
openssl = fold recursiveUpdate {} [
{ "${deps.cargo_vendor."0.1.23".openssl}"."vendored" =
(f.openssl."${deps.cargo_vendor."0.1.23".openssl}"."vendored" or false) ||
(cargo_vendor."0.1.23"."vendored-openssl" or false) ||
(f."cargo_vendor"."0.1.23"."vendored-openssl" or false); }
{ "${deps.cargo_vendor."0.1.23".openssl}".default = true; }
];
serde = fold recursiveUpdate {} [
{ "${deps.cargo_vendor."0.1.23".serde}"."derive" = true; }
{ "${deps.cargo_vendor."0.1.23".serde}".default = true; }
];
serde_json."${deps.cargo_vendor."0.1.23".serde_json}".default = true;
toml."${deps.cargo_vendor."0.1.23".toml}".default = true;
}) [
(cratesIO.features_.cargo."${deps."cargo_vendor"."0.1.23"."cargo"}" deps)
(cratesIO.features_.docopt."${deps."cargo_vendor"."0.1.23"."docopt"}" deps)
(cratesIO.features_.env_logger."${deps."cargo_vendor"."0.1.23"."env_logger"}" deps)
(cratesIO.features_.failure."${deps."cargo_vendor"."0.1.23"."failure"}" deps)
(cratesIO.features_.openssl."${deps."cargo_vendor"."0.1.23"."openssl"}" deps)
(cratesIO.features_.serde."${deps."cargo_vendor"."0.1.23"."serde"}" deps)
(cratesIO.features_.serde_json."${deps."cargo_vendor"."0.1.23"."serde_json"}" deps)
(cratesIO.features_.toml."${deps."cargo_vendor"."0.1.23"."toml"}" deps)
];
# end
};
cargo_vendor = crates.crates.cargo_vendor."0.1.23" deps;
__all = [ (cargo_vendor {}) ];
deps.adler32."1.0.3" = {};
deps.aho_corasick."0.7.3" = {
memchr = "2.2.0";
};
deps.ansi_term."0.11.0" = {
winapi = "0.3.7";
};
deps.atty."0.2.11" = {
termion = "1.5.1";
libc = "0.2.51";
winapi = "0.3.7";
};
deps.autocfg."0.1.2" = {};
deps.backtrace."0.3.15" = {
cfg_if = "0.1.7";
rustc_demangle = "0.1.14";
autocfg = "0.1.2";
backtrace_sys = "0.1.28";
libc = "0.2.51";
winapi = "0.3.7";
};
deps.backtrace_sys."0.1.28" = {
libc = "0.2.51";
cc = "1.0.35";
};
deps.bitflags."1.0.4" = {};
deps.bstr."0.1.2" = {
memchr = "2.2.0";
};
deps.build_const."0.2.1" = {};
deps.byteorder."1.3.1" = {};
deps.bytes."0.4.12" = {
byteorder = "1.3.1";
iovec = "0.1.2";
};
deps.bytesize."1.0.0" = {};
deps.cargo."0.35.0" = {
atty = "0.2.11";
byteorder = "1.3.1";
bytesize = "1.0.0";
clap = "2.33.0";
crates_io = "0.23.0";
crossbeam_utils = "0.6.5";
crypto_hash = "0.3.3";
curl = "0.4.21";
curl_sys = "0.4.18";
env_logger = "0.6.1";
failure = "0.1.5";
filetime = "0.2.4";
flate2 = "1.0.7";
fs2 = "0.4.3";
git2 = "0.8.0";
git2_curl = "0.9.0";
glob = "0.2.11";
hex = "0.3.2";
home = "0.3.4";
ignore = "0.4.7";
im_rc = "12.3.4";
jobserver = "0.1.13";
lazy_static = "1.3.0";
lazycell = "1.2.1";
libc = "0.2.51";
libgit2_sys = "0.7.11";
log = "0.4.6";
num_cpus = "1.10.0";
opener = "0.3.2";
rustc_workspace_hack = "1.0.0";
rustfix = "0.4.5";
same_file = "1.0.4";
semver = "0.9.0";
serde = "1.0.90";
serde_ignored = "0.0.4";
serde_json = "1.0.39";
shell_escape = "0.1.4";
tar = "0.4.22";
tempfile = "3.0.7";
termcolor = "1.0.4";
toml = "0.4.10";
unicode_width = "0.1.5";
url = "1.7.2";
url_serde = "0.2.0";
core_foundation = "0.6.4";
fwdansi = "1.0.1";
miow = "0.3.3";
winapi = "0.3.7";
};
deps.cargo_vendor."0.1.23" = {
cargo = "0.35.0";
docopt = "1.1.0";
env_logger = "0.6.1";
failure = "0.1.5";
openssl = "0.10.20";
serde = "1.0.90";
serde_json = "1.0.39";
toml = "0.5.0";
};
deps.cc."1.0.35" = {};
deps.cfg_if."0.1.7" = {};
deps.clap."2.33.0" = {
atty = "0.2.11";
bitflags = "1.0.4";
strsim = "0.8.0";
textwrap = "0.11.0";
unicode_width = "0.1.5";
vec_map = "0.8.1";
ansi_term = "0.11.0";
};
deps.cloudabi."0.0.3" = {
bitflags = "1.0.4";
};
deps.commoncrypto."0.2.0" = {
commoncrypto_sys = "0.2.0";
};
deps.commoncrypto_sys."0.2.0" = {
libc = "0.2.51";
};
deps.core_foundation."0.6.4" = {
core_foundation_sys = "0.6.2";
libc = "0.2.51";
};
deps.core_foundation_sys."0.6.2" = {};
deps.crates_io."0.23.0" = {
curl = "0.4.21";
failure = "0.1.5";
http = "0.1.17";
serde = "1.0.90";
serde_derive = "1.0.90";
serde_json = "1.0.39";
url = "1.7.2";
};
deps.crc."1.8.1" = {
build_const = "0.2.1";
};
deps.crc32fast."1.2.0" = {
cfg_if = "0.1.7";
};
deps.crossbeam_channel."0.3.8" = {
crossbeam_utils = "0.6.5";
smallvec = "0.6.9";
};
deps.crossbeam_utils."0.6.5" = {
cfg_if = "0.1.7";
lazy_static = "1.3.0";
};
deps.crypto_hash."0.3.3" = {
hex = "0.3.2";
commoncrypto = "0.2.0";
openssl = "0.10.20";
winapi = "0.3.7";
};
deps.curl."0.4.21" = {
curl_sys = "0.4.18";
libc = "0.2.51";
socket2 = "0.3.8";
openssl_probe = "0.1.2";
openssl_sys = "0.9.43";
kernel32_sys = "0.2.2";
schannel = "0.1.15";
winapi = "0.2.8";
};
deps.curl_sys."0.4.18" = {
libc = "0.2.51";
libnghttp2_sys = "0.1.1";
libz_sys = "1.0.25";
cc = "1.0.35";
pkg_config = "0.3.14";
openssl_sys = "0.9.43";
winapi = "0.3.7";
};
deps.docopt."1.1.0" = {
lazy_static = "1.3.0";
regex = "1.1.6";
serde = "1.0.90";
strsim = "0.9.1";
};
deps.either."1.5.2" = {};
deps.env_logger."0.6.1" = {
atty = "0.2.11";
humantime = "1.2.0";
log = "0.4.6";
regex = "1.1.6";
termcolor = "1.0.4";
};
deps.failure."0.1.5" = {
backtrace = "0.3.15";
failure_derive = "0.1.5";
};
deps.failure_derive."0.1.5" = {
proc_macro2 = "0.4.27";
quote = "0.6.12";
syn = "0.15.32";
synstructure = "0.10.1";
};
deps.filetime."0.2.4" = {
cfg_if = "0.1.7";
redox_syscall = "0.1.54";
libc = "0.2.51";
};
deps.flate2."1.0.7" = {
crc32fast = "1.2.0";
libc = "0.2.51";
libz_sys = "1.0.25";
miniz_sys = "0.1.11";
miniz_oxide_c_api = "0.2.1";
};
deps.fnv."1.0.6" = {};
deps.foreign_types."0.3.2" = {
foreign_types_shared = "0.1.1";
};
deps.foreign_types_shared."0.1.1" = {};
deps.fs2."0.4.3" = {
libc = "0.2.51";
winapi = "0.3.7";
};
deps.fuchsia_cprng."0.1.1" = {};
deps.fwdansi."1.0.1" = {
memchr = "2.2.0";
termcolor = "1.0.4";
};
deps.git2."0.8.0" = {
bitflags = "1.0.4";
libc = "0.2.51";
libgit2_sys = "0.7.11";
log = "0.4.6";
url = "1.7.2";
openssl_probe = "0.1.2";
openssl_sys = "0.9.43";
};
deps.git2_curl."0.9.0" = {
curl = "0.4.21";
git2 = "0.8.0";
log = "0.4.6";
url = "1.7.2";
};
deps.glob."0.2.11" = {};
deps.globset."0.4.3" = {
aho_corasick = "0.7.3";
bstr = "0.1.2";
fnv = "1.0.6";
log = "0.4.6";
regex = "1.1.6";
};
deps.hashbrown."0.1.8" = {
byteorder = "1.3.1";
scopeguard = "0.3.3";
};
deps.hex."0.3.2" = {};
deps.home."0.3.4" = {
scopeguard = "0.3.3";
winapi = "0.3.7";
};
deps.http."0.1.17" = {
bytes = "0.4.12";
fnv = "1.0.6";
itoa = "0.4.3";
};
deps.humantime."1.2.0" = {
quick_error = "1.2.2";
};
deps.idna."0.1.5" = {
matches = "0.1.8";
unicode_bidi = "0.3.4";
unicode_normalization = "0.1.8";
};
deps.ignore."0.4.7" = {
crossbeam_channel = "0.3.8";
globset = "0.4.3";
lazy_static = "1.3.0";
log = "0.4.6";
memchr = "2.2.0";
regex = "1.1.6";
same_file = "1.0.4";
thread_local = "0.3.6";
walkdir = "2.2.7";
winapi_util = "0.1.2";
};
deps.im_rc."12.3.4" = {
sized_chunks = "0.1.3";
typenum = "1.10.0";
rustc_version = "0.2.3";
};
deps.iovec."0.1.2" = {
libc = "0.2.51";
winapi = "0.2.8";
};
deps.itertools."0.7.11" = {
either = "1.5.2";
};
deps.itoa."0.4.3" = {};
deps.jobserver."0.1.13" = {
log = "0.4.6";
libc = "0.2.51";
rand = "0.6.5";
};
deps.kernel32_sys."0.2.2" = {
winapi = "0.2.8";
winapi_build = "0.1.1";
};
deps.lazy_static."1.3.0" = {};
deps.lazycell."1.2.1" = {};
deps.libc."0.2.51" = {};
deps.libgit2_sys."0.7.11" = {
curl_sys = "0.4.18";
libc = "0.2.51";
libssh2_sys = "0.2.11";
libz_sys = "1.0.25";
cc = "1.0.35";
pkg_config = "0.3.14";
openssl_sys = "0.9.43";
};
deps.libnghttp2_sys."0.1.1" = {
libc = "0.2.51";
cc = "1.0.35";
};
deps.libssh2_sys."0.2.11" = {
libc = "0.2.51";
libz_sys = "1.0.25";
cc = "1.0.35";
pkg_config = "0.3.14";
openssl_sys = "0.9.43";
};
deps.libz_sys."1.0.25" = {
libc = "0.2.51";
cc = "1.0.35";
pkg_config = "0.3.14";
};
deps.lock_api."0.1.5" = {
scopeguard = "0.3.3";
};
deps.log."0.4.6" = {
cfg_if = "0.1.7";
};
deps.matches."0.1.8" = {};
deps.matrixmultiply."0.1.15" = {
rawpointer = "0.1.0";
};
deps.memchr."2.2.0" = {};
deps.miniz_sys."0.1.11" = {
libc = "0.2.51";
cc = "1.0.35";
};
deps.miniz_oxide."0.2.1" = {
adler32 = "1.0.3";
};
deps.miniz_oxide_c_api."0.2.1" = {
crc = "1.8.1";
libc = "0.2.51";
miniz_oxide = "0.2.1";
cc = "1.0.35";
};
deps.miow."0.3.3" = {
socket2 = "0.3.8";
winapi = "0.3.7";
};
deps.ndarray."0.12.1" = {
itertools = "0.7.11";
matrixmultiply = "0.1.15";
num_complex = "0.2.1";
num_traits = "0.2.6";
};
deps.num_complex."0.2.1" = {
num_traits = "0.2.6";
};
deps.num_traits."0.2.6" = {};
deps.num_cpus."1.10.0" = {
libc = "0.2.51";
};
deps.once_cell."0.1.8" = {
parking_lot = "0.7.1";
};
deps.opener."0.3.2" = {
failure = "0.1.5";
failure_derive = "0.1.5";
winapi = "0.3.7";
};
deps.openssl."0.10.20" = {
bitflags = "1.0.4";
cfg_if = "0.1.7";
foreign_types = "0.3.2";
lazy_static = "1.3.0";
libc = "0.2.51";
openssl_sys = "0.9.43";
};
deps.openssl_probe."0.1.2" = {};
deps.openssl_src."111.2.1+1.1.1b" = {
cc = "1.0.35";
};
deps.openssl_sys."0.9.43" = {
libc = "0.2.51";
cc = "1.0.35";
openssl_src = "111.2.1+1.1.1b";
pkg_config = "0.3.14";
rustc_version = "0.2.3";
};
deps.parking_lot."0.7.1" = {
lock_api = "0.1.5";
parking_lot_core = "0.4.0";
};
deps.parking_lot_core."0.4.0" = {
rand = "0.6.5";
smallvec = "0.6.9";
rustc_version = "0.2.3";
libc = "0.2.51";
winapi = "0.3.7";
};
deps.percent_encoding."1.0.1" = {};
deps.pkg_config."0.3.14" = {};
deps.proc_macro2."0.4.27" = {
unicode_xid = "0.1.0";
};
deps.quick_error."1.2.2" = {};
deps.quote."0.6.12" = {
proc_macro2 = "0.4.27";
};
deps.rand."0.6.5" = {
rand_chacha = "0.1.1";
rand_core = "0.4.0";
rand_hc = "0.1.0";
rand_isaac = "0.1.1";
rand_jitter = "0.1.3";
rand_os = "0.1.3";
rand_pcg = "0.1.2";
rand_xorshift = "0.1.1";
autocfg = "0.1.2";
libc = "0.2.51";
winapi = "0.3.7";
};
deps.rand_chacha."0.1.1" = {
rand_core = "0.3.1";
autocfg = "0.1.2";
};
deps.rand_core."0.3.1" = {
rand_core = "0.4.0";
};
deps.rand_core."0.4.0" = {};
deps.rand_hc."0.1.0" = {
rand_core = "0.3.1";
};
deps.rand_isaac."0.1.1" = {
rand_core = "0.3.1";
};
deps.rand_jitter."0.1.3" = {
rand_core = "0.4.0";
libc = "0.2.51";
winapi = "0.3.7";
};
deps.rand_os."0.1.3" = {
rand_core = "0.4.0";
rdrand = "0.4.0";
cloudabi = "0.0.3";
fuchsia_cprng = "0.1.1";
libc = "0.2.51";
winapi = "0.3.7";
};
deps.rand_pcg."0.1.2" = {
rand_core = "0.4.0";
autocfg = "0.1.2";
};
deps.rand_xorshift."0.1.1" = {
rand_core = "0.3.1";
};
deps.rawpointer."0.1.0" = {};
deps.rdrand."0.4.0" = {
rand_core = "0.3.1";
};
deps.redox_syscall."0.1.54" = {};
deps.redox_termios."0.1.1" = {
redox_syscall = "0.1.54";
};
deps.regex."1.1.6" = {
aho_corasick = "0.7.3";
memchr = "2.2.0";
regex_syntax = "0.6.6";
thread_local = "0.3.6";
utf8_ranges = "1.0.2";
};
deps.regex_syntax."0.6.6" = {
ucd_util = "0.1.3";
};
deps.remove_dir_all."0.5.1" = {
winapi = "0.3.7";
};
deps.rustc_demangle."0.1.14" = {};
deps.rustc_workspace_hack."1.0.0" = {};
deps.rustc_version."0.2.3" = {
semver = "0.9.0";
};
deps.rustfix."0.4.5" = {
failure = "0.1.5";
log = "0.4.6";
serde = "1.0.90";
serde_derive = "1.0.90";
serde_json = "1.0.39";
};
deps.ryu."0.2.7" = {};
deps.same_file."1.0.4" = {
winapi_util = "0.1.2";
};
deps.schannel."0.1.15" = {
lazy_static = "1.3.0";
winapi = "0.3.7";
};
deps.scopeguard."0.3.3" = {};
deps.semver."0.9.0" = {
semver_parser = "0.7.0";
serde = "1.0.90";
};
deps.semver_parser."0.7.0" = {};
deps.serde."1.0.90" = {
serde_derive = "1.0.90";
};
deps.serde_derive."1.0.90" = {
proc_macro2 = "0.4.27";
quote = "0.6.12";
syn = "0.15.32";
};
deps.serde_ignored."0.0.4" = {
serde = "1.0.90";
};
deps.serde_json."1.0.39" = {
itoa = "0.4.3";
ryu = "0.2.7";
serde = "1.0.90";
};
deps.shell_escape."0.1.4" = {};
deps.sized_chunks."0.1.3" = {
typenum = "1.10.0";
};
deps.smallvec."0.6.9" = {};
deps.socket2."0.3.8" = {
cfg_if = "0.1.7";
libc = "0.2.51";
redox_syscall = "0.1.54";
winapi = "0.3.7";
};
deps.strsim."0.8.0" = {};
deps.strsim."0.9.1" = {
hashbrown = "0.1.8";
ndarray = "0.12.1";
};
deps.syn."0.15.32" = {
proc_macro2 = "0.4.27";
quote = "0.6.12";
unicode_xid = "0.1.0";
};
deps.synstructure."0.10.1" = {
proc_macro2 = "0.4.27";
quote = "0.6.12";
syn = "0.15.32";
unicode_xid = "0.1.0";
};
deps.tar."0.4.22" = {
filetime = "0.2.4";
redox_syscall = "0.1.54";
libc = "0.2.51";
};
deps.tempfile."3.0.7" = {
cfg_if = "0.1.7";
rand = "0.6.5";
remove_dir_all = "0.5.1";
redox_syscall = "0.1.54";
libc = "0.2.51";
winapi = "0.3.7";
};
deps.termcolor."1.0.4" = {
wincolor = "1.0.1";
};
deps.termion."1.5.1" = {
libc = "0.2.51";
redox_syscall = "0.1.54";
redox_termios = "0.1.1";
};
deps.textwrap."0.11.0" = {
unicode_width = "0.1.5";
};
deps.thread_local."0.3.6" = {
lazy_static = "1.3.0";
};
deps.toml."0.4.10" = {
serde = "1.0.90";
};
deps.toml."0.5.0" = {
serde = "1.0.90";
};
deps.typenum."1.10.0" = {};
deps.ucd_util."0.1.3" = {};
deps.unicode_bidi."0.3.4" = {
matches = "0.1.8";
};
deps.unicode_normalization."0.1.8" = {
smallvec = "0.6.9";
};
deps.unicode_width."0.1.5" = {};
deps.unicode_xid."0.1.0" = {};
deps.url."1.7.2" = {
idna = "0.1.5";
matches = "0.1.8";
percent_encoding = "1.0.1";
};
deps.url_serde."0.2.0" = {
serde = "1.0.90";
url = "1.7.2";
};
deps.utf8_ranges."1.0.2" = {};
deps.vcpkg."0.2.6" = {};
deps.vec_map."0.8.1" = {};
deps.walkdir."2.2.7" = {
same_file = "1.0.4";
winapi = "0.3.7";
winapi_util = "0.1.2";
};
deps.winapi."0.2.8" = {};
deps.winapi."0.3.7" = {
winapi_i686_pc_windows_gnu = "0.4.0";
winapi_x86_64_pc_windows_gnu = "0.4.0";
};
deps.winapi_build."0.1.1" = {};
deps.winapi_i686_pc_windows_gnu."0.4.0" = {};
deps.winapi_util."0.1.2" = {
winapi = "0.3.7";
};
deps.winapi_x86_64_pc_windows_gnu."0.4.0" = {};
deps.wincolor."1.0.1" = {
winapi = "0.3.7";
winapi_util = "0.1.2";
};
}

View File

@ -0,0 +1,10 @@
{ callPackage, fetchFromGitHub }:
((callPackage ./cargo-vendor-carnix.nix {}).cargo_vendor {}).overrideAttrs (attrs: {
src = fetchFromGitHub {
owner = "alexcrichton";
repo = "cargo-vendor";
rev = "9355661303ce2870d68a69d99953fce22581e31e";
sha256 = "0d4j3r09am3ynwhczimzv39264f5xz37jxa9js123y46w5by3wd2";
};
})

View File

@ -0,0 +1,61 @@
{ stdenv, file, curl, pkgconfig, python, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
, fetchurl
}:
rustPlatform.buildRustPackage rec {
# Note: we can't build cargo 1.28.0 because rustc tightened the borrow checker rules and broke
# backward compatibility, which affects old cargo versions.
name = "cargo-${version}";
version = "1.37.0";
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-1.37.0-src.tar.gz";
sha256 = "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj";
};
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
cargoVendorDir = "vendor";
preBuild = "pushd src/tools/cargo";
postBuild = "popd";
passthru.rustc = rustc;
# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;
nativeBuildInputs = [ pkgconfig cmake makeWrapper ];
buildInputs = [ cacert file curl python openssl zlib libgit2 ];
LIBGIT2_SYS_USE_PKG_CONFIG = 1;
# fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel
RUSTC_BOOTSTRAP = 1;
postInstall = ''
# NOTE: We override the `http.cainfo` option usually specified in
# `.cargo/config`. This is an issue when users want to specify
# their own certificate chain as environment variables take
# precedence
wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin" \
--set CARGO_HTTP_CAINFO "${cacert}/etc/ssl/certs/ca-bundle.crt" \
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
'';
checkPhase = ''
# Disable cross compilation tests
export CFG_DISABLE_CROSS_TESTS=1
cargo test
'';
# Disable check phase as there are failures (4 tests fail)
doCheck = false;
meta = with stdenv.lib; {
homepage = https://crates.io;
description = "Downloads your Rust project's dependencies and builds your project";
maintainers = with maintainers; [ wizeman retrry ];
license = [ licenses.mit licenses.asl20 ];
platforms = platforms.unix;
};
}

View File

@ -81,11 +81,15 @@ let
''; '';
}; };
in in
runCommand "rustc" {} stdenv.mkDerivation {
'' name = "rustc";
inherit src version;
buildCommand = ''
mkdir -p $out/lib/rustlib/or1k-unknown-none/lib/ mkdir -p $out/lib/rustlib/or1k-unknown-none/lib/
cp -r ${or1k-crates}/* $out/lib/rustlib/or1k-unknown-none/lib/ cp -r ${or1k-crates}/* $out/lib/rustlib/or1k-unknown-none/lib/
mkdir -p $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/ mkdir -p $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/
cp -r ${arm-crates}/* $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/ cp -r ${arm-crates}/* $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/
cp -r ${rustc_internal}/* $out cp -r ${rustc_internal}/* $out
'' '';
passAsFile = [ "buildCommand" ];
}

View File

@ -9,7 +9,7 @@ in
vivado vivado
pkgs.gnumake pkgs.gnumake
(pkgs.python3.withPackages(ps: (with ps; [ jinja2 numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ]))) (pkgs.python3.withPackages(ps: (with ps; [ jinja2 numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ])))
pkgs.cargo artiqpkgs.cargo
artiqpkgs.rustc artiqpkgs.rustc
artiqpkgs.binutils-or1k artiqpkgs.binutils-or1k
artiqpkgs.binutils-arm artiqpkgs.binutils-arm

View File

@ -1,7 +1,7 @@
# Install Vivado in /opt and add to /etc/nixos/configuration.nix: # Install Vivado in /opt and add to /etc/nixos/configuration.nix:
# nix.sandboxPaths = ["/opt"]; # nix.sandboxPaths = ["/opt"];
{ pkgs, vivadoPath ? "/opt/Xilinx/Vivado/2019.2" }: { pkgs, vivadoPath ? "/opt/Xilinx/Vivado/2020.1" }:
pkgs.buildFHSUserEnv { pkgs.buildFHSUserEnv {
name = "vivado"; name = "vivado";

16
artiq-fast/wfvm.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs }:
let
# Pin nixpkgs to avoid frequent resource-intensive Windows reinstallations on Hydra.
wfvm-pkgs = pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "f8248ab6d9e69ea9c07950d73d48807ec595e923";
sha256 = "009i9j6mbq6i481088jllblgdnci105b2q4mscprdawg3knlyahk";
};
wfvm = pkgs.fetchgit {
url = "https://git.m-labs.hk/M-Labs/wfvm.git";
rev = "304a102b61ae1649739129510bbfc2f162e069b7";
sha256 = "0ss7z5inp2fbrqjpp296iy04m8v3bwiajhwa7w5ijixva5v2mmg0";
};
in import "${wfvm}/wfvm" { pkgs = (import wfvm-pkgs {}); }

View File

@ -1,25 +0,0 @@
# Preparation steps
## Install a Windows image
```shell
nix-build install.nix -I artiqSrc=…/artiq
result/bin/windows-installer.sh
```
Follow the instructions.
## Install Anaconda to the image
```shell
result/bin/anaconda-installer.sh
```
Move the image `c.img` to one of Nix' `extra-sandbox-paths` (`nix.sandboxPaths` on NixOS).
# Running the tests manually
```shell
nix-build --pure --arg diskImage "\"…/c.img\"" -I artiqSrc=…/artiq manual-test-run.nix
```

View File

@ -0,0 +1,17 @@
{ pkgs } : [
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/noarch/prettytable-0.7.2-py_3.tar.bz2";
sha256 = "0b7s4xm6bbkcg37sf1i3mxrbac0vxhryq22m3qx4x9kh6k2c5g5q";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/noarch/pycparser-2.20-py_0.tar.bz2";
sha256 = "1qwcb07q8cjz0qpj6pfxb0qb68kddmx9bv9wr5pghwz78q8073z9";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/noarch/six-1.15.0-py_0.tar.bz2";
sha256 = "08rsfp9bd2mz8r120s8w5vgncy0gn732xa0lfgbmx833548cfqmb";
})
]

View File

@ -0,0 +1,27 @@
{ pkgs } : [
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/noarch/prettytable-0.7.2-py_3.tar.bz2";
sha256 = "0b7s4xm6bbkcg37sf1i3mxrbac0vxhryq22m3qx4x9kh6k2c5g5q";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/noarch/six-1.15.0-py_0.tar.bz2";
sha256 = "08rsfp9bd2mz8r120s8w5vgncy0gn732xa0lfgbmx833548cfqmb";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/noarch/python-dateutil-2.8.1-py_0.tar.bz2";
sha256 = "0cbcd0jq6683ibj8ncsmmrbhbjvwww8i22lb68bx4xfzsmb9z8cb";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/noarch/cached-property-1.5.1-py_1.tar.bz2";
sha256 = "1yl6h3wb6hxgw79i7rpgpq260l5vqfcj5dv5kyxn8z99xdkp52q5";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/noarch/pycparser-2.20-py_0.tar.bz2";
sha256 = "1qwcb07q8cjz0qpj6pfxb0qb68kddmx9bv9wr5pghwz78q8073z9";
})
]

View File

@ -0,0 +1,167 @@
{ pkgs } : [
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/pyqt-5.9.2-py35h6538335_2.tar.bz2";
sha256 = "1anwq53nic50cijngxaylpn6232j9wdc2wz2rykqpgzvs1ms108s";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/zlib-1.2.11-h62dcd97_4.tar.bz2";
sha256 = "1jxd7sg0c278hqv09q6hridpdnyhkd34gbs92wkravj3gwsr1adk";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/openssl-1.1.1g-he774522_0.tar.bz2";
sha256 = "1gwfj33qb8inikdhmgcm30iz1ag8x71lzicsxbdr7ni4153df5gb";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_random-1.0.1-py35h77b88f5_1.tar.bz2";
sha256 = "0899qg9ih8srpw9q5mxd85hg4gpawb7lmz25x9xi401cfwhgwq7l";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/hdf5-1.10.2-hac2f561_1.tar.bz2";
sha256 = "0l1i5bpxl0bn9hf738ywygjwc32d4cq5fjkgzij3x27cxi8nvd21";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/tbb4py-2018.0.5-py35he980bc4_0.tar.bz2";
sha256 = "0gypjcmciw3rnd2cq0sqmvspgzaas13fghv633dqj8g3bvl4lfif";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/wheel-0.31.1-py35_0.tar.bz2";
sha256 = "07zmbg57lpvqd9nmahiff1mhzxmzchx1v128dcrj4iamymjcdlzf";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
})
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/win-64/pygit2-0.27.1-py35hfa6e2cd_0.tar.bz2";
sha256 = "1jypm8vxs4j4yr37ai4ki9qsslv3wz6slklmisnvjraz1a4vzaf8";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/pip-10.0.1-py35_0.tar.bz2";
sha256 = "0zwlkfgnag1s64wbwdcg44zqj2dpfcq1g4b6dsk82q24j7fw40i3";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/h5py-2.8.0-py35h3bdd7fb_2.tar.bz2";
sha256 = "0743wrf51b2vs8ybasjpn7ricbh740r7drxcimkhbxp8r6vd66vp";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-1.15.2-py35ha559c80_0.tar.bz2";
sha256 = "1igf4gm726s4kg7km24flxdxr73fafaz3z18y3ndcb5f6r9zwa44";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl-2018.0.3-1.tar.bz2";
sha256 = "01pq0f2787q58avg5ylfrbpf4jlg2b6rbajvf3swjpm1cmzxkm81";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/libssh2-1.9.0-h7a1dbc1_1.tar.bz2";
sha256 = "0sz405ab3n7991hxy8l9affs1slivsimgadxsdr6wvpgx3j4aqgx";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/tk-8.6.10-he774522_0.tar.bz2";
sha256 = "15bfncacdxmcbn4xixmfz2m7a09k7hcpwxvwn1lki84bx0fmzsis";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/sqlite-3.32.2-h2a8f88b_0.tar.bz2";
sha256 = "086jjnxfchypkr8cp1q8nsis0jfvl293bv4bcg7ikv7aia3vda8p";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/wincertstore-0.2-py35hfebbdb8_0.tar.bz2";
sha256 = "1624bzqlbiq4jlz46l65574smw739p7l38ydzxmayq3jmwx6zaar";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/certifi-2018.8.24-py35_1.tar.bz2";
sha256 = "06ygpkx3f71rwmq9lgc29r6jj4g1zi8rvrmn4mrrsb9b5sf0rzgf";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/icu-58.2-ha925a31_3.tar.bz2";
sha256 = "0vcl0j3v9ab022s2g3a9iv1pn7sflh670yyf5m08hdyf049m3jz7";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/regex-2018.08.29-py35hfa6e2cd_0.tar.bz2";
sha256 = "16cjgwpaqnfy8bg35iz12bb9whpws4abiz4cq4shpnh6gnwpwzj3";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/cffi-1.11.5-py35h74b6da3_1.tar.bz2";
sha256 = "0nc3ps4xl8rqpwiqaqqr5lrqzk8lx1a4hh3fpm7i7rlppqn5pm6a";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/libcurl-7.69.1-h2a8f88b_0.tar.bz2";
sha256 = "182zrmgl2142gfgnbgjsk0gbj85vw75xzxvhn9lzm485ghxsasvg";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_fft-1.0.6-py35hdbbee80_0.tar.bz2";
sha256 = "0xb02rx28rjlp5clavg19jb129ihcarrkz46pncaar91qxckbbxz";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/pyqtgraph-0.10.0-py35h28b3542_3.tar.bz2";
sha256 = "0ywzw3i4kf5ccck9whmg1j7s22x6i5fpywndy8rkr9va38g4nazq";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/sip-4.19.8-py35h6538335_0.tar.bz2";
sha256 = "1y761zpm6bi0pb61x1y26ap56hylh6mjg1xq9zl08bmcl2dlkwfy";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/setuptools-40.2.0-py35_0.tar.bz2";
sha256 = "146piyifnip1flqph19nxilnhfbzzsxlhfyx0i61wv7krr6ln9yy";
})
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/win-64/python-levenshtein-0.12.0-py35_0.tar.bz2";
sha256 = "1rdpzv1y535swf17nm88chkp1m8w3wd3nwdy7jk1xfcnx1da5ss6";
})
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/win-64/libgit2-0.27.8-hfac1375_0.tar.bz2";
sha256 = "05pjzwmm5vyxwcgi6vv3i961x3dgdd9c4b1ihagq9kyxgqfy21kd";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/scipy-1.1.0-py35h4f6bf74_1.tar.bz2";
sha256 = "0sdyj5nlycv4krz7f8rzhi0kxv302gpx65x1zwhj8dn6b2c50li0";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/curl-7.69.1-h2a8f88b_0.tar.bz2";
sha256 = "0hw5dh7gzx8fap4c3vkc2xc2q9by3f5ndbigr6pm6w5v29qaydn4";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/intel-openmp-2019.4-245.tar.bz2";
sha256 = "13qid5aagyxsfy5ng4bbwb7hs9jj29jvqbpvvkjiy6bgv36m8kr8";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-base-1.15.2-py35h8128ebf_0.tar.bz2";
sha256 = "166w4wkp9dwl505hc00hny1mq2mlvb169n7c9nws7dz8j36pqfrx";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/python-3.5.6-he025d50_0.tar.bz2";
sha256 = "0ygvmbyvhc2jisb5bzb0r5709qmn8392gr7rv6c8vrdiylfiqr73";
})
]

View File

@ -0,0 +1,132 @@
{ pkgs } : [
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/regex-2020.5.14-py37he774522_0.tar.bz2";
sha256 = "125l0ywc17h5hlpidjbr7dxyz9c24xmfjllj19dmvbx8hdlmvp99";
})
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/win-64/python_abi-3.7-1_cp37m.tar.bz2";
sha256 = "04dllvrvczky7p7d82iqj7czmy5mm8w7h2gg0zpjzx0s09gkq09l";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/icu-58.2-ha925a31_3.tar.bz2";
sha256 = "0vcl0j3v9ab022s2g3a9iv1pn7sflh670yyf5m08hdyf049m3jz7";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/pip-20.1.1-py37_1.tar.bz2";
sha256 = "0wx0sdjq2kkdid4m0iss1bxjhpdk1lnrqsl3w7bqc0papz3gbx0a";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_fft-1.1.0-py37h45dec08_0.tar.bz2";
sha256 = "1v73rd107x1r77gv77cn2bv50hr15c0rwspzf7pdp93i5ydk7fm0";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/tk-8.6.10-he774522_0.tar.bz2";
sha256 = "15bfncacdxmcbn4xixmfz2m7a09k7hcpwxvwn1lki84bx0fmzsis";
})
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/win-64/pygit2-1.2.1-py37h4ab8f01_0.tar.bz2";
sha256 = "1rj6bmf56g3imcrhfd67nqfzd5jjpnmbck714p6aqljxjw5x1zja";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/certifi-2020.6.20-py37_0.tar.bz2";
sha256 = "0601dwm5grhwnq7kvhz9sr49pw72ji8xbc28jc6z3pzihin243fy";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/libssh2-1.9.0-h7a1dbc1_1.tar.bz2";
sha256 = "0sz405ab3n7991hxy8l9affs1slivsimgadxsdr6wvpgx3j4aqgx";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/intel-openmp-2020.1-216.tar.bz2";
sha256 = "097kkdpd27gc5v5fwsanbrpvmkqricbkd2igglz0yym0x2rldgb8";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/zlib-1.2.11-h62dcd97_4.tar.bz2";
sha256 = "1jxd7sg0c278hqv09q6hridpdnyhkd34gbs92wkravj3gwsr1adk";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/pyqtgraph-0.10.0-py37h28b3542_3.tar.bz2";
sha256 = "1vfxym7lpiv624ll82yp07v2906chdzvczjj9xbvfvk2sk0w1nk7";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/python-levenshtein-0.12.0-py37he774522_1001.tar.bz2";
sha256 = "0wgk6wi4hcc1msv6467y8rhd3zpxrlb6dc0a4fg5wrvzww9wh4dx";
})
(pkgs.fetchurl {
url = "https://conda.anaconda.org/conda-forge/win-64/libgit2-1.0.0-h79a9ecc_0.tar.bz2";
sha256 = "1pi4hd4kah49wzy00iml5wpbscc0lx6ljk6lwnx92gas5z8856jd";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/setuptools-47.3.1-py37_0.tar.bz2";
sha256 = "1lljknly57bh73h30hn6vv826dx4vls736psa9jvf0d6l2kqrzrq";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/libcurl-7.69.1-h2a8f88b_0.tar.bz2";
sha256 = "182zrmgl2142gfgnbgjsk0gbj85vw75xzxvhn9lzm485ghxsasvg";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_random-1.1.1-py37h47e9c7a_0.tar.bz2";
sha256 = "1f85bd7rrzdprgmk83v1klana32j016128fkxk8kpk7idfd36zqv";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/python-3.7.7-h81c818b_4.tar.bz2";
sha256 = "092bv939n68yjkcm7q626nd6s5kqqvdrgjfqn1nadnqig612w2p9";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/curl-7.69.1-h2a8f88b_0.tar.bz2";
sha256 = "0hw5dh7gzx8fap4c3vkc2xc2q9by3f5ndbigr6pm6w5v29qaydn4";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/openssl-1.1.1g-he774522_0.tar.bz2";
sha256 = "1gwfj33qb8inikdhmgcm30iz1ag8x71lzicsxbdr7ni4153df5gb";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/scipy-1.5.0-py37h9439919_0.tar.bz2";
sha256 = "01pj0a82y9qd9z5fn5gv4argcc5g5s8kqj0lwjy9hj50qf6qwj76";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-1.18.5-py37h6530119_0.tar.bz2";
sha256 = "1knb5na7ij7ik76blsgwhdsy3i9r2l0154z5g5dkb2ds3sk878np";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/sqlite-3.32.3-h2a8f88b_0.tar.bz2";
sha256 = "1ddzwj0f6jikj6hsasg3vlwamsqhf5lc8k1la7gqbd77s11b8isc";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-base-1.18.5-py37hc3f5095_0.tar.bz2";
sha256 = "1dyxk2v7rm87najv3f8i04q44wxicfx9qrap9dy2vpqlrz3bj82j";
})
(pkgs.fetchurl {
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl-2020.1-216.tar.bz2";
sha256 = "1klj0sjlj5x1anjbkf017f16ssc65dkpg1rrn06njirbhwsc9w5m";
})
]

View File

@ -1,91 +0,0 @@
{ pkgs ? import <nixpkgs> {},
diskImageSize ? "22G",
qemuMem ? "4G",
}:
with pkgs;
let
windowsIso = fetchurl {
url = "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso";
sha256 = "668fe1af70c2f7416328aee3a0bb066b12dc6bbd2576f40f812b95741e18bc3a";
};
anaconda = fetchurl {
url = "https://repo.anaconda.com/archive/Anaconda3-2019.03-Windows-x86_64.exe";
sha256 = "1f9icm5rwab6l1f23a70dw0qixzrl62wbglimip82h4zhxlh3jfj";
};
escape = builtins.replaceStrings [ "\\" ] [ "\\\\" ];
qemu = import ./qemu.nix {
inherit pkgs qemuMem;
diskImage = "c.img";
};
# Double-escape because we produce a script from a shell heredoc
ssh = cmd: qemu.ssh (escape cmd);
scp = qemu.scp;
sshCondaEnv = cmd: ssh "anaconda\\scripts\\activate && ${cmd}";
condaEnv = "artiq-env";
condaDepSpecs =
builtins.concatStringsSep " "
(map (s: "\"${s}\"")
(import ../conda-artiq-deps.nix));
instructions =
builtins.toFile "install.txt"
(builtins.readFile ./install.txt);
in
stdenv.mkDerivation {
name = "windows-installer";
src = windowsIso;
setSourceRoot = "sourceRoot=`pwd`";
unpackCmd = ''
ln -s $curSrc windows.iso
'';
propagatedBuildInputs = qemu.inputs;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin $out/data
ln -s $(readlink windows.iso) $out/data/windows.iso
cat > $out/bin/windows-installer.sh << EOF
#!/usr/bin/env bash
set -e -m
${qemu.qemu-img} create -f qcow2 c.img ${diskImageSize}
${qemu.runQemu false [] [
"-boot" "order=d"
"-drive" "file=c.img,index=0,media=disk,cache=unsafe"
"-drive" "file=$out/data/windows.iso,index=1,media=cdrom,cache=unsafe"
]} &
cat ${instructions}
wait
EOF
cat > $out/bin/anaconda-installer.sh << EOF
#!/usr/bin/env bash
set -e -m
${qemu.runQemu false [] [
"-boot" "order=c"
"-drive" "file=c.img,index=0,media=disk"
]} &
sleep 10
${ssh "ver"}
${scp anaconda "Anaconda.exe"}
${ssh "start /wait \"\" Anaconda.exe /S /D=%cd%\\anaconda"}
${sshCondaEnv "conda config --add channels conda-forge"}
${sshCondaEnv "conda config --add channels m-labs"}
( ${sshCondaEnv "conda update -y conda"} ) || true
${sshCondaEnv "conda update -y --all"}
${sshCondaEnv "conda create -y -n ${condaEnv}"}
${sshCondaEnv "conda install -y -n ${condaEnv} ${condaDepSpecs}"}
${ssh "shutdown /p /f"}
echo "Waiting for qemu exit"
wait
EOF
chmod a+x $out/bin/*.sh
'';
}

View File

@ -1,13 +0,0 @@
Add user account with expected password [user/user].
Enable the OpenSSH server:
- "Add or remove programs"
- "Manage optional features"
- "Add a feature"
- "OpenSSH Server"
- "Install"
- Open "Services"
- Double-click the "OpenSSH SSH Server" service
- Set "Startup type" to "Automatic"
- "Start"
- "Ok"
Then press ENTER here to proceed with automatic installation

View File

@ -0,0 +1,74 @@
#!/usr/bin/env bash
# run manually to build the list of conda dependencies to install in the
# test environments.
set -e
nix-build -E "
let
pkgs = import <nixpkgs> {};
wfvm = import ../wfvm.nix { inherit pkgs; };
in
wfvm.utils.wfvm-run {
name = \"get-conda-packages\";
image = wfvm.makeWindowsImage { installCommands = [ wfvm.layers.anaconda3 ]; };
# TODO: fix wfvm login expiry and also remove 'date' workarounds below
#fakeRtc = false;
isolateNetwork = false;
script = ''
cat > getcondapackages.bat << EOF
date 06-22-20
call conda config --prepend channels https://conda.m-labs.hk/artiq-beta
call conda config --append channels conda-forge
call conda create -n artiq -y
call conda install --dry-run --json -n artiq artiq > packages.json
date 04-20-20
EOF
\${wfvm.utils.win-put}/bin/win-put getcondapackages.bat
\${wfvm.utils.win-exec}/bin/win-exec '.\Anaconda3\Scripts\activate && getcondapackages'
\${wfvm.utils.win-get}/bin/win-get packages.json
'';
}
"
./result/bin/wfvm-run-get-conda-packages
python -c "
import json
with open('packages.json') as json_file:
packages = json.load(json_file)
with open('packages_noarch.txt', 'w') as list_noarch:
with open('packages_win-64.txt', 'w') as list_win64:
for fetch in packages['actions']['FETCH']:
if 'm-labs' not in fetch['channel']:
if fetch['subdir'] == 'noarch':
list = list_noarch
elif fetch['subdir'] == 'win-64':
list = list_win64
else:
raise ValueError
url = fetch['url']
if url.endswith('.conda'):
url = url[:-6] + '.tar.bz2'
print(url, file=list)
"
for type in "noarch" "win-64"; do
echo Downloading $type packages
out=conda_$type\_packages.nix
echo "{ pkgs } : [" > $out
while read package; do
hash=$(nix-prefetch-url $package)
echo "
(pkgs.fetchurl {
url = \"$package\";
sha256 = \"$hash\";
})" >> $out
done < packages_$type.txt
echo "]" >> $out
done
rm result getcondapackages.bat packages.json packages_noarch.txt packages_win-64.txt

View File

@ -1,30 +1,10 @@
# This runs `run-test.nix` with `nix-build` { pkgs ? import <nixpkgs> {} }:
{ pkgs ? import <nixpkgs> {},
artiqpkgs ? import ../. { inherit pkgs; },
diskImage ? "/opt/windows/c.img",
qemuMem ? "2G",
testTimeout ? 180,
}:
with pkgs;
let let
windowsRunner = overrides: artiqpkgs = import ../. { inherit pkgs; };
import ./run-test.nix ({ run-test = import ./run-test.nix {
inherit pkgs diskImage qemuMem testTimeout; inherit pkgs artiqpkgs;
sipycoPkg = artiqpkgs.conda-sipyco; testCommand = "set ARTIQ_ROOT=%cd%\\Anaconda3\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&& python -m unittest discover -v sipyco.test && python -m unittest discover -v artiq.test";
artiqPkg = artiqpkgs.conda-artiq; };
} // overrides);
in in
run-test
stdenv.mkDerivation {
name = "windows-test";
phases = [ "installPhase" "checkPhase" ];
installPhase = "touch $out";
doCheck = true;
checkPhase = ''
${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\anaconda\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&&python -m unittest discover -v artiq.test"; }}/bin/run.sh
'';
}

View File

@ -1,55 +0,0 @@
{ pkgs,
diskImage,
qemuMem,
sshUser ? "user",
sshPassword ? "user",
}:
with pkgs;
let
qemu-img = "${qemu_kvm}/bin/qemu-img";
runQemu = isolateNetwork: forwardedPorts: extraArgs:
let
restrict =
if isolateNetwork
then "on"
else "off";
# use socat instead of `tcp:…` to allow multiple connections
guestfwds =
builtins.concatStringsSep ""
(map ({ listenAddr, targetAddr, port }:
",guestfwd=tcp:${listenAddr}:${toString port}-cmd:${socat}/bin/socat\\ -\\ tcp:${targetAddr}:${toString port}"
) forwardedPorts);
args = [
"-enable-kvm"
"-m" qemuMem
"-bios" "${OVMF.fd}/FV/OVMF.fd"
"-netdev" "user,id=n1,net=192.168.1.0/24,restrict=${restrict},hostfwd=tcp::2022-:22${guestfwds}"
"-device" "e1000,netdev=n1"
];
argStr = builtins.concatStringsSep " " (args ++ extraArgs);
in "${qemu_kvm}/bin/qemu-system-x86_64 ${argStr}";
# Pass empty config file to prevent ssh from failing to create ~/.ssh
sshOpts = "-F /dev/null -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=\$TMP/known_hosts";
sshWithQuotes = quotes: cmd: ''
echo ssh windows ${quotes}${cmd}${quotes}
${sshpass}/bin/sshpass -p${sshPassword} -- \
${openssh}/bin/ssh -np 2022 ${sshOpts} \
${sshUser}@localhost \
${quotes}${cmd}${quotes}
'';
ssh = sshWithQuotes "'";
scp = src: target: ''
echo "Copy ${src} to ${target}"
${sshpass}/bin/sshpass -p${sshPassword} -- \
${openssh}/bin/scp -P 2022 ${sshOpts} \
"${src}" "${sshUser}@localhost:${target}"
'';
in
{
inherit qemu-img runQemu ssh sshWithQuotes scp;
inputs = [ qemu_kvm openssh sshpass ];
}

View File

@ -1,24 +1,6 @@
{ pkgs, { pkgs, artiqpkgs, testCommand, testTimeout ? 600 }:
sipycoPkg,
artiqPkg,
diskImage ? "/opt/windows/c.img",
qemuMem ? "2G",
testTimeout ? 600,
testCommand ? "python -m unittest discover -v sipyco.test && python -m unittest discover -v artiq.test",
}:
with pkgs;
let let
escape = builtins.replaceStrings [ "\\" ] [ "\\\\" ];
qemu = import ./qemu.nix {
inherit pkgs qemuMem;
diskImage = "c.img";
};
# Double-escape because we produce a script from a shell heredoc
ssh = cmd: qemu.ssh (escape cmd);
sshUnquoted = qemu.sshWithQuotes "\"";
scp = qemu.scp;
condaEnv = "artiq-env"; condaEnv = "artiq-env";
tcpPorts = [ 1380 1381 1382 1383 ]; tcpPorts = [ 1380 1381 1382 1383 ];
forwardedPorts = forwardedPorts =
@ -27,58 +9,51 @@ let
targetAddr = "192.168.1.50"; targetAddr = "192.168.1.50";
inherit port; inherit port;
}) tcpPorts; }) tcpPorts;
wfvm = import ../wfvm.nix { inherit pkgs; };
conda-deps = {
name = "conda-deps";
script = let
artiq6 = pkgs.lib.strings.versionAtLeast artiqpkgs.artiq.version "6.0";
conda-deps-noarch = import (if artiq6 then ./conda_noarch_packages.nix else ./conda_noarch_packages-legacy.nix) { inherit pkgs; };
conda-deps-win-64 = import (if artiq6 then ./conda_win-64_packages.nix else ./conda_win-64_packages-legacy.nix) { inherit pkgs; };
conda-packages-put = pkgs.lib.strings.concatStringsSep "\n"
( (map (package: ''win-put ${package} 'fake-channel/noarch' '') conda-deps-noarch)
++ (map (package: ''win-put ${package} 'fake-channel/win-64' '') conda-deps-win-64) );
in in
''
win-exec 'mkdir fake-channel && mkdir fake-channel\noarch && mkdir fake-channel\win-64'
stdenv.mkDerivation { ${conda-packages-put}
name = "windows-test-runner";
src = ./.;
propagatedBuildInputs = qemu.inputs; win-put ${artiqpkgs.conda-windows-binutils-or1k}/win-64/*.tar.bz2 'fake-channel/win-64'
dontBuild = true; win-put ${artiqpkgs.conda-windows-llvm-or1k}/win-64/*.tar.bz2 'fake-channel/win-64'
installPhase = '' win-put ${artiqpkgs.conda-windows-llvmlite-artiq}/win-64/*.tar.bz2 'fake-channel/win-64'
mkdir -p $out/bin
cat > $out/bin/run.sh << EOF
#!/usr/bin/env bash
set -e -m
# +1 day from last modification of the disk image win-put ${artiqpkgs.conda-pythonparser}/noarch/*.tar.bz2 'fake-channel/noarch'
CLOCK=$(date -Is -d @$(expr $(stat -c %Y ${diskImage}) + 86400)) win-put ${artiqpkgs.conda-sipyco}/noarch/*.tar.bz2 'fake-channel/noarch'
${qemu.runQemu true forwardedPorts [ win-put ${artiqpkgs.conda-quamash}/noarch/*.tar.bz2 'fake-channel/noarch'
"-boot" "order=c" '';
"-snapshot" };
"-drive" "file=${diskImage},index=0,media=disk,cache=unsafe" in
"-rtc" "base=\\$CLOCK" wfvm.utils.wfvm-run {
"-display" "none" name = "windows-tests";
]} & image = wfvm.makeWindowsImage { installCommands = [ wfvm.layers.anaconda3 conda-deps ]; };
inherit forwardedPorts;
script =
''
${wfvm.utils.win-put}/bin/win-put ${artiqpkgs.conda-artiq}/noarch/*.tar.bz2 'fake-channel/noarch'
echo "Wait for Windows to boot" ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
sleep 30 ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda create -n ${condaEnv} --offline"
${ssh "ver"} ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate ${condaEnv} && conda install -y -c file:///C:/users/wfvm/fake-channel --offline artiq"\
i=0
for pkg in ${sipycoPkg}/noarch/sipyco*.tar.bz2 ${artiqPkg}/noarch/artiq*.tar.bz2 ; do
${scp "\\$pkg" "to_install\\$i.tar.bz2"}
${sshUnquoted "anaconda\\scripts\\activate ${condaEnv} && conda install to_install\\$i.tar.bz2"}
((i=i+1))
done
# Schedule a timed shutdown against hanging test runs # Schedule a timed shutdown against hanging test runs
${ssh "shutdown -s -t ${toString testTimeout}"} ${wfvm.utils.win-exec}/bin/win-exec "shutdown -s -t ${toString testTimeout}"
FAIL=n ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate ${condaEnv} && ${testCommand}"
( ${ssh "anaconda\\scripts\\activate ${condaEnv} && ${testCommand}"} ) || FAIL=y
# Abort timeouted shutdown # Abort timeouted shutdown
${ssh "shutdown -a"} ${wfvm.utils.win-exec}/bin/win-exec "shutdown -a"
# Power off immediately
${ssh "shutdown -p -f"}
wait
if [ "\$FAIL" = "y" ]; then
exit 1
else
exit 0
fi
EOF
chmod a+x $out/bin/run.sh
''; '';
} }

View File

@ -28,32 +28,43 @@ let
variants = [ variants = [
"afmaster" "afmaster"
"afsatellite" "afsatellite"
"berkeley"
"berkeley2" "berkeley2"
"berkeley3"
"csu" "csu"
"duke" "duke"
"duke2" "duke2"
"duke3" "duke3"
"femto1"
"femto2"
"femto3"
"freiburg1" "freiburg1"
"griffith"
"hub" "hub"
"hustmaster"
"hustsatellite"
"hw" "hw"
"indiana" "indiana"
"innsbruck2" "innsbruck2"
"ist" "ist"
"liaf"
"luh" "luh"
"luh2"
"luh3"
"mikes"
"mit" "mit"
"mitll" "mitll3"
"mitll2" "mitll4master"
"mitll4satellite"
"mpik" "mpik"
"mpq" "mpq"
"nrc" "nict"
"nudt" "nist"
"no"
"npl1" "npl1"
"npl2" "npl2"
"oklahoma"
"olomouc"
"opticlock" "opticlock"
"oregon" "oregon"
"osaka"
"ptb" "ptb"
"ptb2" "ptb2"
"ptb3" "ptb3"
@ -62,31 +73,36 @@ let
"ptb6" "ptb6"
"ptbal" "ptbal"
"ptbin" "ptbin"
"purdue"
"qe"
"qleds"
"rice"
"saymamaster" "saymamaster"
"siegen" "siegen"
"su" "su"
"sysu" "sydney"
"tsinghua" "uaarhus"
"tsinghua2"
"ubirmingham" "ubirmingham"
"ucr" "ugranada"
"unsw" "unlv"
"unsw2" "unsw2"
"ustc" "ustc2"
"vlbaimaster" "vlbaimaster"
"vlbaisatellite" "vlbaisatellite"
"wipm" "wipm"
"wipm2"
"wipm3"
"wipm4" "wipm4"
"wipm5master" "wipm5master"
"wipm5satellite" "wipm5satellite"
] ++ (pkgs.lib.lists.optionals (pkgs.lib.strings.versionAtLeast artiq-fast.artiq.version "6.0") [ ] ++ (pkgs.lib.lists.optionals (pkgs.lib.strings.versionAtLeast artiq-fast.artiq.version "6.0") [
"bonn1master" "bonn1master"
"bonn1satellite" "bonn1satellite"
"hw2master"
"hw2satellite"
"uamsterdam"
]); ]);
artiq-board = import ./fast/artiq-board.nix { inherit pkgs; }; vivado = import ./fast/vivado.nix { inherit pkgs; };
artiq-board = import ./fast/artiq-board.nix { inherit pkgs vivado; };
conda-artiq-board = import ./conda-artiq-board.nix { inherit pkgs; }; conda-artiq-board = import ./conda-artiq-board.nix { inherit pkgs; };
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://git.m-labs.hk/M-Labs/sinara-systems.git"; url = "https://git.m-labs.hk/M-Labs/sinara-systems.git";
@ -127,10 +143,10 @@ let
"1" = "afsatellite"; "1" = "afsatellite";
}; };
}; };
hust = { mitll4 = {
master = "hustmaster"; master = "mitll4master";
satellites = { satellites = {
"1" = "hustsatellite"; "1" = "mitll4satellite";
}; };
}; };
vlbai = { vlbai = {
@ -152,6 +168,12 @@ let
"1" = "bonn1satellite"; "1" = "bonn1satellite";
}; };
}; };
hw2 = {
master = "hw2master";
satellites = {
"1" = "hw2satellite";
};
};
}); });
drtio-ddbs = pkgs.lib.attrsets.mapAttrs' drtio-ddbs = pkgs.lib.attrsets.mapAttrs'
(system: crates: pkgs.lib.attrsets.nameValuePair ("device-db-" + system) (system: crates: pkgs.lib.attrsets.nameValuePair ("device-db-" + system)
@ -206,6 +228,11 @@ let
variant = "master"; variant = "master";
boardBinaries = artiq-board-metlino-master; boardBinaries = artiq-board-metlino-master;
}; };
conda-artiq-board-kasli-tester = conda-artiq-board {
target = "kasli";
variant = "tester";
boardBinaries = artiq-fast.artiq-board-kasli-tester;
};
conda-artiq-board-kc705-nist_clock = conda-artiq-board { conda-artiq-board-kc705-nist_clock = conda-artiq-board {
target = "kc705"; target = "kc705";
variant = "nist_clock"; variant = "nist_clock";
@ -238,7 +265,7 @@ in
artiq-full = pkgs.releaseTools.channel { artiq-full = pkgs.releaseTools.channel {
name = "artiq-full"; name = "artiq-full";
src = generatedNix; src = generatedNix;
constituents = builtins.attrValues jobs; constituents = [];
}; };
conda-channel = import ./artiq-full/conda-channel.nix { inherit pkgs; } { inherit jobs; }; conda-channel = import ./artiq-full/conda-channel.nix { inherit pkgs; } { inherit jobs; };
} }

View File

@ -40,7 +40,7 @@ let
EOF EOF
chmod 755 $out/fake-conda/build.sh chmod 755 $out/fake-conda/build.sh
''; '';
conda-artiq-board = import ./fast/conda-build.nix { inherit pkgs; } { conda-artiq-board = import ./fast/conda/build.nix { inherit pkgs; } {
name = "conda-artiq-board-${target}-${variant}"; name = "conda-artiq-board-${target}-${variant}";
src = fakeCondaSource; src = fakeCondaSource;
}; };

View File

@ -2,11 +2,11 @@
{ jobs }: { jobs }:
let let
condaBuilderEnv = import <artiq-fast/conda-builder-env.nix> { inherit pkgs; }; condaBuilderEnv = import <artiq-fast/conda/builder-env.nix> { inherit pkgs; };
in in
pkgs.runCommand "conda-channel" { } pkgs.runCommand "conda-channel" { }
'' ''
mkdir -p $out/noarch mkdir -p $out/noarch $out/linux-64 $out/win-64
for storepath in ${pkgs.lib.concatMapStringsSep " " builtins.toString (builtins.attrValues jobs)}; do for storepath in ${pkgs.lib.concatMapStringsSep " " builtins.toString (builtins.attrValues jobs)}; do
hydra_build_products=$storepath/nix-support/hydra-build-products hydra_build_products=$storepath/nix-support/hydra-build-products
if [ -f $hydra_build_products ]; then if [ -f $hydra_build_products ]; then
@ -14,7 +14,8 @@ in
type=`echo $line | cut -f2 -d " "` type=`echo $line | cut -f2 -d " "`
if [ $type == "conda" ]; then if [ $type == "conda" ]; then
path=`echo $line | cut -f3 -d " "` path=`echo $line | cut -f3 -d " "`
ln -s $path $out/noarch arch=`echo $path | cut -f5 -d "/"`
ln -s $path $out/$arch
fi fi
done < $hydra_build_products done < $hydra_build_products
fi fi

View File

@ -1,7 +1,7 @@
{ pkgs, sipyco, asyncserial, artiq }: { pkgs, sipyco, asyncserial, artiq }:
let let
condaBuild = import ./fast/conda-build.nix { inherit pkgs; }; condaBuild = import ./fast/conda/build.nix { inherit pkgs; };
condaFakeSource = import ./fast/conda-fake-source.nix { inherit pkgs; }; condaFakeSource = import ./fast/conda/fake-source.nix { inherit pkgs; };
dualPackage = ( dualPackage = (
{ name, version, src, pythonOptions ? {}, condaOptions ? {}}: { name, version, src, pythonOptions ? {}, condaOptions ? {}}:
{ {
@ -147,8 +147,8 @@ in
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "quartiq"; owner = "quartiq";
repo = "lasersdk-artiq"; repo = "lasersdk-artiq";
rev = "f96d0e81aa47beb468fa4d73d92dad0872d8a960"; rev = "901dec13a1bf9429ce7ab49be34b03d1c49b8a9f";
sha256 = "1z6yc4h7fjw5b3f50asdk1kp65sj4hhxmdzsh1ay8g3n1c9g3hh5"; sha256 = "0lqxvgvpgrpw1kzhg5axnfb40ils2vdk75r43hqmk2lfz4sydwb2";
}; };
postPatch = '' postPatch = ''
substituteInPlace lasersdk_artiq/aqctl_laser.py \ substituteInPlace lasersdk_artiq/aqctl_laser.py \
@ -186,12 +186,12 @@ in
}) // rec { }) // rec {
artiq-comtools = pkgs.python3Packages.buildPythonPackage rec { artiq-comtools = pkgs.python3Packages.buildPythonPackage rec {
name = "artiq-comtools-${version}"; name = "artiq-comtools-${version}";
version = "1.0"; version = "1.1";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "artiq-comtools"; repo = "artiq-comtools";
rev = "398f6becdaf89ec2e115106778467f9a766a2007"; rev = "v${version}";
sha256 = "02i2a1mmzc7jixq4nkbmi1a4c0gk6kmm8bv1dxrka7m56nb9sk9w"; sha256 = "165j12k9nnrkf2pv0idcv6xhnp1hnsllna4rps2dssnqgjfaw1ss";
}; };
propagatedBuildInputs = [ sipyco pkgs.python3Packages.numpy pkgs.python3Packages.aiohttp ]; propagatedBuildInputs = [ sipyco pkgs.python3Packages.numpy pkgs.python3Packages.aiohttp ];
}; };

View File

@ -1,6 +1,6 @@
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
let let
jobs = import ./cpld/default.nix { inherit pkgs; }; jobs = import ./gluelogic/default.nix { inherit pkgs; };
in in
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs

View File

@ -1,11 +1,11 @@
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
let let
migen = (pkgs.callPackage ../artiq-fast/pkgs/python-deps.nix {}).migen; artiqpkgs = import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) stdenv fetchFromGitHub python3Packages; };
ise = import ./ise.nix { inherit pkgs; }; ise = import ./ise.nix { inherit pkgs; };
buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation { buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "urukul-cpld-${version}"; name = "urukul-cpld-${version}";
inherit src; inherit src;
buildInputs = [(pkgs.python3.withPackages(ps: [migen]))] ++ (builtins.attrValues ise); buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"]; phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/urukul_impl.py"; buildPhase = "python $src/urukul_impl.py";
installPhase = installPhase =
@ -18,7 +18,7 @@ let
buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation { buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "mirny-cpld-${version}"; name = "mirny-cpld-${version}";
inherit src; inherit src;
buildInputs = [(pkgs.python3.withPackages(ps: [migen]))] ++ (builtins.attrValues ise); buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"]; phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/mirny_impl.py"; buildPhase = "python $src/mirny_impl.py";
installPhase = installPhase =
@ -35,6 +35,15 @@ in
src = <urukulSrc>; src = <urukulSrc>;
}; };
urukul-cpld-release = buildUrukulCpld rec { urukul-cpld-release = buildUrukulCpld rec {
version = "1.4.0";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "urukul";
rev = "v${version}";
sha256 = "1962jpzqzn22cwkcmfnvwqlj5i89pljhgfk64n6pk73clir9mp0w";
};
};
urukul-cpld-legacy = buildUrukulCpld rec {
version = "1.3.1"; version = "1.3.1";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "quartiq"; owner = "quartiq";
@ -56,4 +65,17 @@ in
sha256 = "0fyz0g1h1s54zdivkfqhgyhpq7gjkl9kxkcfy3104p2f889l1vgw"; sha256 = "0fyz0g1h1s54zdivkfqhgyhpq7gjkl9kxkcfy3104p2f889l1vgw";
}; };
}; };
fastino-fpga = pkgs.stdenv.mkDerivation {
name = "fastino-fpga";
src = <fastinoSrc>;
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen artiqpkgs.misoc]))] ++ [pkgs.yosys pkgs.nextpnr pkgs.icestorm];
phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/fastino_phy.py";
installPhase =
''
mkdir -p $out $out/nix-support
cp build/fastino.bin $out
echo file binary-dist $out/fastino.bin >> $out/nix-support/hydra-build-products
'';
};
} }

View File

@ -10,7 +10,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false } "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
} }
} }

View File

@ -16,7 +16,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git master 1", "emailresponsible": false } "artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git master 1", "emailresponsible": false }
} }
@ -33,7 +33,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false }, "sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-beta:generated-nix", "emailresponsible": false } "artiq-fast": { "type": "sysbuild", "value": "artiq:fast-beta:generated-nix", "emailresponsible": false }
@ -51,7 +51,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-5 1", "emailresponsible": false } "artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-5 1", "emailresponsible": false }
} }
@ -68,28 +68,49 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false }, "sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false } "artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false }
} }
}, },
"cpld": { "gluelogic": {
"enabled": 1, "enabled": 1,
"hidden": false, "hidden": false,
"description": "CPLD gateware", "description": "Glue logic gateware for Sinara devices",
"nixexprinput": "nixScripts", "nixexprinput": "nixScripts",
"nixexprpath": "cpld.nix", "nixexprpath": "gluelogic.nix",
"checkinterval": 172800, "checkinterval": 172800,
"schedulingshares": 1, "schedulingshares": 1,
"enableemail": false, "enableemail": false,
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"urukulSrc": { "type": "git", "value": "git://github.com/quartiq/urukul", "emailresponsible": false }, "urukulSrc": { "type": "git", "value": "git://github.com/quartiq/urukul", "emailresponsible": false },
"mirnySrc": { "type": "git", "value": "git://github.com/quartiq/mirny", "emailresponsible": false } "mirnySrc": { "type": "git", "value": "git://github.com/quartiq/mirny", "emailresponsible": false },
"fastinoSrc": { "type": "git", "value": "git://github.com/quartiq/fastino", "emailresponsible": false }
}
},
"zynq": {
"enabled": 1,
"hidden": false,
"description": "ARTIQ on the Zynq-based ZC706 board",
"nixexprinput": "nixScripts",
"nixexprpath": "zynq.nix",
"checkinterval": 300,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"mozillaOverlay": { "type": "git", "value": "git://github.com/mozilla/nixpkgs-mozilla", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-beta:generated-nix", "emailresponsible": false },
"zc706": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/zc706.git", "emailresponsible": false },
"artiq-zynq": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/artiq-zynq.git", "emailresponsible": false }
} }
} }
} }

View File

@ -10,7 +10,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false } "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
} }
} }

View File

@ -16,7 +16,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"mozillaOverlay": { "type": "git", "value": "git://github.com/mozilla/nixpkgs-mozilla.git", "emailresponsible": false }, "mozillaOverlay": { "type": "git", "value": "git://github.com/mozilla/nixpkgs-mozilla.git", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"stabilizerSrc": { "type": "git", "value": "git://github.com/quartiq/stabilizer.git", "emailresponsible": false }, "stabilizerSrc": { "type": "git", "value": "git://github.com/quartiq/stabilizer.git", "emailresponsible": false },

View File

@ -10,7 +10,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false } "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
} }
} }

View File

@ -16,7 +16,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false } "webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false }
} }

View File

@ -1,54 +0,0 @@
{ config, pkgs, lib, ... }:
with lib;
let
makeBackup = pkgs.writeScript "make-backup" ''
#!${pkgs.bash}/bin/bash
set -e
umask 0077
DBDUMPDIR=`mktemp -d`
pushd $DBDUMPDIR
${config.services.mysql.package}/bin/mysqldump --single-transaction flarum > flarum.sql
${pkgs.sudo}/bin/sudo -u mattermost ${config.services.postgresql.package}/bin/pg_dump mattermost > mattermost.sql
${pkgs.gnutar}/bin/tar cf - --exclude "/var/lib/gitea/repositories/*/*.git/archives" /etc/nixos /var/lib/gitea flarum.sql mattermost.sql | \
${pkgs.bzip2}/bin/bzip2 | \
${pkgs.gnupg}/bin/gpg --symmetric --batch --passphrase-file /etc/nixos/secret/backup-passphrase | \
${pkgs.rclone}/bin/rclone rcat --config /etc/nixos/secret/rclone.conf dropbox:backup-`date +%F`.tar.bz2.gpg
popd
rm -rf $DBDUMPDIR
echo Backup done
'';
cfg = config.services.mlabs-backup;
in
{
options.services.mlabs-backup = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable backups";
};
};
config = mkIf cfg.enable {
systemd.services.mlabs-backup = {
description = "M-Labs backup";
serviceConfig = {
Type = "oneshot";
User = "root";
Group = "root";
ExecStart = "${makeBackup}";
};
};
systemd.timers.mlabs-backup = {
description = "M-Labs backup";
wantedBy = [ "timers.target" ];
timerConfig.OnCalendar = "weekly";
};
};
}

View File

@ -1,630 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
let
netifWan = "enp0s31f6";
netifLan = "enp3s0";
netifWifi = "wlp1s0";
netifSit = "henet0";
hydraWwwOutputs = "/var/www/hydra-outputs";
in
{
imports =
[
./hardware-configuration.nix
./homu/nixos-module.nix
./backup-module.nix
(builtins.fetchTarball {
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.3.0/nixos-mailserver-v2.3.0.tar.gz";
sha256 = "0lpz08qviccvpfws2nm83n7m2r8add2wvfg9bljx9yxx8107r919";
})
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.blacklistedKernelModules = ["iwlwifi"];
security.apparmor.enable = true;
security.pam.yubico = {
enable = true;
id = "49094";
control = "required";
};
networking = {
hostName = "nixbld";
firewall = {
allowedTCPPorts = [ 80 443 ];
allowedUDPPorts = [ 53 67 ];
trustedInterfaces = [ netifLan ];
};
interfaces."${netifLan}" = {
ipv4.addresses = [{
address = "192.168.1.1";
prefixLength = 24;
}];
ipv6.addresses = [{
address = "2001:470:f821:1::";
prefixLength = 64;
}];
};
interfaces."${netifWifi}" = {
ipv4.addresses = [{
address = "192.168.12.1";
prefixLength = 24;
}];
ipv6.addresses = [{
address = "2001:470:f821:2::";
prefixLength = 64;
}];
};
nat = {
enable = true;
externalInterface = netifWan;
internalInterfaces = [ netifLan netifWifi ];
forwardPorts = [
{ sourcePort = 2201; destination = "192.168.1.201:22"; proto = "tcp"; }
{ sourcePort = 2202; destination = "192.168.1.202:22"; proto = "tcp"; }
{ sourcePort = 2203; destination = "192.168.1.203:22"; proto = "tcp"; }
{ sourcePort = 2204; destination = "192.168.1.204:22"; proto = "tcp"; }
];
extraCommands = ''
iptables -w -N block-lan-from-wifi
iptables -w -A block-lan-from-wifi -i ${netifLan} -o ${netifWifi} -j DROP
iptables -w -A block-lan-from-wifi -i ${netifWifi} -o ${netifLan} -j DROP
iptables -w -A FORWARD -j block-lan-from-wifi
'';
extraStopCommands = ''
iptables -w -D FORWARD -j block-lan-from-wifi 2>/dev/null|| true
iptables -w -F block-lan-from-wifi 2>/dev/null|| true
iptables -w -X block-lan-from-wifi 2>/dev/null|| true
'';
};
sits."${netifSit}" = {
dev = netifWan;
remote = "216.218.221.6";
local = "42.200.147.171";
ttl = 255;
};
interfaces."${netifSit}".ipv6 = {
addresses = [{ address = "2001:470:18:629::2"; prefixLength = 64; }];
routes = [{ address = "::"; prefixLength = 0; }];
};
};
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1";
boot.kernel.sysctl."net.ipv6.conf.default.forwarding" = "1";
services.hostapd = {
enable = true;
interface = netifWifi;
hwMode = "g";
ssid = "M-Labs";
wpaPassphrase = (import /etc/nixos/secret/wifi_password.nix);
extraConfig = ''
ieee80211d=1
country_code=HK
ieee80211n=1
wmm_enabled=1
auth_algs=1
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
'';
};
services.dnsmasq = {
enable = true;
extraConfig = ''
interface=${netifLan}
interface=${netifWifi}
bind-interfaces
dhcp-range=interface:${netifLan},192.168.1.81,192.168.1.254,24h
dhcp-range=interface:${netifWifi},192.168.12.10,192.168.12.254,24h
enable-ra
dhcp-range=interface:${netifLan},::,constructor:${netifLan},ra-names
dhcp-range=interface:${netifWifi},::,constructor:${netifWifi},ra-only
# Static IPv4s to make port redirections work
dhcp-host=rpi-1,192.168.1.201
dhcp-host=rpi-2,192.168.1.202
dhcp-host=rpi-3,192.168.1.203
dhcp-host=rpi-4,192.168.1.204
# Default IP addresses for ARTIQ boards
address=/thermostat/192.168.1.26
address=/kc705/192.168.1.50
address=/zc706/192.168.1.51
address=/sayma/192.168.1.60
address=/kasli/192.168.1.70
address=/kasli-customer/192.168.1.75
# uTCA MCH from NAT
address=/tschernobyl/192.168.1.80
'';
};
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "de";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "Asia/Hong_Kong";
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget vim git file lm_sensors acpi pciutils psmisc gdb telnet whois zip unzip nixops
irssi tmux tigervnc xorg.xauth icewm xterm xorg.xsetroot usbutils imagemagick jq
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
# List services that you want to enable:
services.apcupsd.enable = true;
services.apcupsd.configText = ''
UPSTYPE usb
NISIP 127.0.0.1
BATTERYLEVEL 10
MINUTES 5
'';
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.forwardX11 = true;
programs.mosh.enable = true;
programs.fish.enable = true;
# Enable CUPS to print documents.
services.avahi.enable = true;
services.avahi.interfaces = [ netifLan ];
services.avahi.publish.enable = true;
services.avahi.publish.userServices = true;
nixpkgs.config.allowUnfree = true;
services.printing.enable = true;
services.printing.drivers = [ pkgs.hplipWithPlugin ];
services.printing.browsing = true;
services.printing.listenAddresses = [ "*:631" ];
services.printing.defaultShared = true;
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];
users.extraGroups.plugdev = { };
users.extraUsers.sb = {
isNormalUser = true;
extraGroups = ["wheel" "plugdev" "dialout" "lp" "scanner"];
shell = pkgs.fish;
};
users.extraUsers.rj = {
isNormalUser = true;
extraGroups = ["wheel" "plugdev" "dialout"];
};
users.extraUsers.astro = {
isNormalUser = true;
extraGroups = ["plugdev" "dialout"];
};
users.extraUsers.nix = {
isNormalUser = true;
};
security.sudo.wheelNeedsPassword = false;
security.hideProcessInformation = true;
boot.kernel.sysctl."kernel.dmesg_restrict" = true;
services.udev.packages = [ pkgs.sane-backends ];
nix.distributedBuilds = true;
nix.buildMachines = [
{
hostName = "localhost";
maxJobs = 4;
system = "x86_64-linux";
supportedFeatures = ["big-parallel"];
}
{
hostName = "rpi-3";
sshUser = "nix";
sshKey = "/etc/nixos/secret/nix_id_rsa";
maxJobs = 1;
system = "aarch64-linux";
}
];
services.hydra = {
enable = true;
useSubstitutes = true;
hydraURL = "https://nixbld.m-labs.hk";
notificationSender = "hydra@m-labs.hk";
minimumDiskFree = 15; # in GB
minimumDiskFreeEvaluator = 1;
extraConfig =
''
binary_cache_secret_key_file = /etc/nixos/secret/nixbld.m-labs.hk-1
max_output_size = 10000000000
<runcommand>
job = web:web:web
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/web
</runcommand>
<runcommand>
job = artiq:full:sipyco-manual-html
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/sipyco-manual-html
</runcommand>
<runcommand>
job = artiq:full:sipyco-manual-latexpdf
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/sipyco-manual-latexpdf
</runcommand>
<runcommand>
job = artiq:full-beta:artiq-manual-html
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-manual-html-beta
</runcommand>
<runcommand>
job = artiq:full-beta:artiq-manual-latexpdf
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-manual-latexpdf-beta
</runcommand>
<runcommand>
job = artiq:full-beta:conda-channel
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-conda-channel-beta
</runcommand>
<runcommand>
job = artiq:full:artiq-manual-html
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-manual-html
</runcommand>
<runcommand>
job = artiq:full:artiq-manual-latexpdf
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-manual-latexpdf
</runcommand>
<runcommand>
job = artiq:full:conda-channel
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-conda-channel
</runcommand>
'';
};
systemd.services.hydra-www-outputs-init = {
description = "Set up a hydra-owned directory for build outputs";
wantedBy = [ "multi-user.target" ];
requiredBy = [ "hydra-queue-runner.service" ];
before = [ "hydra-queue-runner.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = [ "${pkgs.coreutils}/bin/mkdir -p ${hydraWwwOutputs}" "${pkgs.coreutils}/bin/chown hydra-queue-runner:hydra ${hydraWwwOutputs}" ];
};
};
nix.extraOptions = ''
secret-key-files = /etc/nixos/secret/nixbld.m-labs.hk-1
'';
nix.sandboxPaths = ["/opt"];
services.munin-node.enable = true;
services.munin-cron = {
enable = true;
hosts = ''
[${config.networking.hostName}]
address localhost
'';
};
services.mlabs-backup.enable = true;
services.gitea = {
enable = true;
httpPort = 3001;
rootUrl = "https://git.m-labs.hk/";
appName = "M-Labs Git";
cookieSecure = true;
disableRegistration = true;
mailerPasswordFile = "/etc/nixos/secret/mailerpassword";
extraConfig =
''
[mailer]
ENABLED = true
HOST = ssl.serverraum.org:587
FROM = sysop@m-labs.hk
USER = sysop@m-labs.hk
[attachment]
ALLOWED_TYPES = */*
'';
};
systemd.tmpfiles.rules = [
"L+ '${config.services.gitea.stateDir}/custom/templates/home.tmpl' - - - - ${./gitea-home.tmpl}"
];
services.mattermost = {
enable = true;
siteUrl = "https://chat.m-labs.hk/";
mutableConfig = true;
};
services.matterbridge = {
enable = true;
configPath = "/etc/nixos/secret/matterbridge.toml";
};
nixpkgs.config.packageOverrides = super: let self = super.pkgs; in {
firmwareLinuxNonfree = super.callPackage ./firmware-linux-nonfree.nix {};
hydra = super.hydra.overrideAttrs(oa: {
patches = oa.patches or [] ++ [ ./hydra-conda.patch ./hydra-retry.patch ];
hydraPath = oa.hydraPath + ":" + super.lib.makeBinPath [ super.jq ];
});
matterbridge = super.matterbridge.overrideAttrs(oa: {
patches = oa.patches or [] ++ [ ./matterbridge-disable-github.patch ];
});
nixops = super.nixops.overrideAttrs(oa: {
patches = oa.patches or [] ++ [ ./nixops-665.patch ];
});
# https://github.com/NixOS/nixpkgs/issues/70930
# perl 5.30 breaks plugins
munin = super.munin.override {
perlPackages = super.perl528Packages;
rrdtool = super.rrdtool.override {
perl = super.perl528Packages.perl;
};
};
};
security.acme.certs = {
"nixbld.m-labs.hk" = {
webroot = "/var/lib/acme/acme-challenge";
extraDomains = {
"m-labs.hk" = null;
"www.m-labs.hk" = null;
"conda.m-labs.hk" = null;
"lab.m-labs.hk" = null;
"git.m-labs.hk" = null;
"chat.m-labs.hk" = null;
"hooks.m-labs.hk" = null;
"forum.m-labs.hk" = null;
"perso.m-labs.hk" = null;
"openhardware.hk" = null;
"git.openhardware.hk" = null;
};
};
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedGzipSettings = true;
virtualHosts = let
mainWebsite = {
addSSL = true;
useACMEHost = "nixbld.m-labs.hk";
root = "${hydraWwwOutputs}/web";
extraConfig = ''
error_page 404 /404.html;
'';
locations."^~ /fonts/".extraConfig = ''
expires 60d;
'';
locations."^~ /js/".extraConfig = ''
expires 60d;
'';
locations."/MathJax/" = {
alias = "/var/www/MathJax/";
extraConfig = ''
expires 60d;
'';
};
# legacy URLs, redirect to avoid breaking people's bookmarks
locations."/gateware.html".extraConfig = ''
return 301 /gateware/migen/;
'';
locations."/migen".extraConfig = ''
return 301 /gateware/migen/;
'';
locations."/artiq".extraConfig = ''
return 301 /experiment-control/artiq/;
'';
locations."/artiq/resources.html".extraConfig = ''
return 301 /experiment-control/resources/;
'';
# autogenerated manuals
locations."/artiq/sipyco-manual/" = {
alias = "${hydraWwwOutputs}/sipyco-manual-html/share/doc/sipyco-manual/html/";
};
locations."=/artiq/sipyco-manual.pdf" = {
alias = "${hydraWwwOutputs}/sipyco-manual-latexpdf/share/doc/sipyco-manual/SiPyCo.pdf";
};
locations."/artiq/manual-beta/" = {
alias = "${hydraWwwOutputs}/artiq-manual-html-beta/share/doc/artiq-manual/html/";
};
locations."=/artiq/manual-beta.pdf" = {
alias = "${hydraWwwOutputs}/artiq-manual-latexpdf-beta/share/doc/artiq-manual/ARTIQ.pdf";
};
locations."/artiq/manual/" = {
alias = "${hydraWwwOutputs}/artiq-manual-html/share/doc/artiq-manual/html/";
};
locations."=/artiq/manual.pdf" = {
alias = "${hydraWwwOutputs}/artiq-manual-latexpdf/share/doc/artiq-manual/ARTIQ.pdf";
};
# legacy content
locations."/migen/manual/" = {
alias = "/var/www/m-labs.hk.old/migen/manual/";
};
locations."/artiq/manual-release-4/" = {
alias = "/var/www/m-labs.hk.old/artiq/manual-release-4/";
};
locations."/artiq/manual-release-3/" = {
alias = "/var/www/m-labs.hk.old/artiq/manual-release-3/";
};
locations."/artiq/manual-release-2/" = {
alias = "/var/www/m-labs.hk.old/artiq/manual-release-2/";
};
};
in {
"m-labs.hk" = mainWebsite;
"www.m-labs.hk" = mainWebsite;
"lab.m-labs.hk" = {
addSSL = true;
useACMEHost = "nixbld.m-labs.hk";
locations."/munin/".alias = "/var/www/munin/";
locations."/munin".extraConfig = ''
auth_basic "Munin";
auth_basic_user_file /etc/nixos/secret/muninpasswd;
'';
locations."/homu/".proxyPass = "http://127.0.0.1:54856/";
};
"nixbld.m-labs.hk" = {
forceSSL = true;
useACMEHost = "nixbld.m-labs.hk";
locations."/".proxyPass = "http://127.0.0.1:3000";
};
"conda.m-labs.hk" = {
forceSSL = true;
useACMEHost = "nixbld.m-labs.hk";
locations."/artiq-beta/" = {
alias = "${hydraWwwOutputs}/artiq-conda-channel-beta/";
extraConfig = ''
autoindex on;
index bogus_index_file;
'';
};
locations."/artiq/" = {
alias = "${hydraWwwOutputs}/artiq-conda-channel/";
extraConfig = ''
autoindex on;
index bogus_index_file;
'';
};
};
"git.m-labs.hk" = {
forceSSL = true;
useACMEHost = "nixbld.m-labs.hk";
locations."/".proxyPass = "http://127.0.0.1:3001";
extraConfig = ''
client_max_body_size 300M;
'';
};
"chat.m-labs.hk" = {
forceSSL = true;
useACMEHost = "nixbld.m-labs.hk";
locations."/".proxyPass = "http://127.0.0.1:8065";
locations."~ /api/v[0-9]+/(users/)?websocket$".proxyPass = "http://127.0.0.1:8065";
locations."~ /api/v[0-9]+/(users/)?websocket$".proxyWebsockets = true;
};
"hooks.m-labs.hk" = {
forceSSL = true;
useACMEHost = "nixbld.m-labs.hk";
locations."/".extraConfig = ''
include ${pkgs.nginx}/conf/uwsgi_params;
uwsgi_pass unix:${config.services.uwsgi.runDir}/uwsgi.sock;
'';
};
"forum.m-labs.hk" = {
forceSSL = true;
useACMEHost = "nixbld.m-labs.hk";
root = "/var/www/flarum/public";
locations."~ \.php$".extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.flarum.socket};
fastcgi_index index.php;
'';
extraConfig = ''
index index.php;
include /var/www/flarum/.nginx.conf;
'';
};
"perso.m-labs.hk" = {
addSSL = true;
useACMEHost = "nixbld.m-labs.hk";
root = "/var/www/perso";
};
"git.openhardware.hk" = {
forceSSL = true;
useACMEHost = "nixbld.m-labs.hk";
locations."/".proxyPass = "http://127.0.0.1:3002";
extraConfig = ''
client_max_body_size 300M;
'';
};
};
};
services.uwsgi = {
enable = true;
plugins = [ "python3" ];
instance = {
type = "emperor";
vassals = {
mattermostgithub = import ./mattermost-github-integration/uwsgi-config.nix { inherit config pkgs; };
};
};
};
services.mysql = {
enable = true;
package = pkgs.mariadb;
};
services.phpfpm.pools.flarum = {
user = "nobody";
settings = {
"listen.owner" = "nginx";
"listen.group" = "nginx";
"listen.mode" = "0600";
"pm" = "dynamic";
"pm.max_children" = 5;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 3;
"pm.max_requests" = 500;
};
};
services.homu = {
enable = true;
config = "/etc/nixos/secret/homu.toml";
};
mailserver = {
enable = true;
localDnsResolver = false; # conflicts with dnsmasq
# Some mail servers do reverse DNS lookups to filter spam.
# Getting a proper reverse DNS record from ISP is difficult, so use whatever already exists.
fqdn = "42-200-147-171.static.imsbiz.com";
domains = [ "nmigen.org" ];
loginAccounts = (import /etc/nixos/secret/email_accounts.nix);
certificateScheme = 3;
};
security.acme.certs."${config.mailserver.fqdn}".extraDomains = {
"mail.nmigen.org" = null;
};
containers.openhardwarehk = {
autoStart = true;
config =
{ config, pkgs, ... }:
{
services.gitea = {
enable = true;
httpPort = 3002;
rootUrl = "https://git.openhardware.hk/";
appName = "Open Hardware HK";
cookieSecure = true;
disableRegistration = true;
extraConfig =
''
[attachment]
ALLOWED_TYPES = */*
'';
};
};
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "18.09"; # Did you read the comment?
}

View File

@ -1,23 +0,0 @@
{{template "base/head" .}}
<div class="home">
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<div>
<img class="logo" src="{{AppSubUrl}}/img/gitea-lg.png" />
</div>
<div class="hero">
<h1 class="ui icon header title">
{{AppName}}
</h1>
</div>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center column">
<p class="large">
Welcome! This Gitea instance is here to support projects related to <a href="https://m-labs.hk">M-Labs</a>. You may want to browse the <a href="https://git.m-labs.hk/M-Labs/">M-Labs organization</a> where many projects are located. If you would like an account (we give them to anyone who wants to contribute on projects related to Sinara, ARTIQ, nMigen, etc.), simply write a short email to sb@m-***.hk stating the username you would like to have.
</p>
</div>
</div>
</div>
{{template "base/footer" .}}

View File

@ -1,13 +0,0 @@
diff --git a/homu/git_helper.py b/homu/git_helper.py
index 0f70c69..f53fb57 100755
--- a/homu/git_helper.py
+++ b/homu/git_helper.py
@@ -7,7 +7,7 @@ SSH_KEY_FILE = os.path.join(os.path.dirname(__file__), '../cache/key')
def main():
- args = ['ssh', '-i', SSH_KEY_FILE, '-S', 'none'] + sys.argv[1:]
+ args = ['ssh', '-o', 'StrictHostKeyChecking=no', '-i', SSH_KEY_FILE, '-S', 'none'] + sys.argv[1:]
os.execvp('ssh', args)

View File

@ -1,52 +0,0 @@
{ config, pkgs, lib, ... }:
with lib;
let
homu = pkgs.callPackage ./pkg.nix {};
cfg = config.services.homu;
in
{
options.services.homu = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the bot";
};
dbDir = mkOption {
type = types.str;
default = "/var/db/homu";
description = "Path to the database file (use the same path in config.toml)";
};
config = mkOption {
description = "Location of config.toml";
type = types.str;
};
};
config = mkIf cfg.enable {
users.users.homu = {
group = "homu";
home = cfg.dbDir;
createHome = true;
};
users.groups.homu = {};
systemd.services.homu = {
description = "Homu bot";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${homu}/bin/homu -c ${cfg.config}";
Restart = "always";
RestartSec = "5sec";
User = "homu";
Group = "homu";
};
};
};
}

View File

@ -1,26 +0,0 @@
diff --git a/homu/git_helper.py b/homu/git_helper.py
index 0f70c69..732230c 100755
--- a/homu/git_helper.py
+++ b/homu/git_helper.py
@@ -3,7 +3,7 @@
import sys
import os
-SSH_KEY_FILE = os.path.join(os.path.dirname(__file__), '../cache/key')
+SSH_KEY_FILE = os.path.expanduser("~/cache/key")
def main():
diff --git a/homu/main.py b/homu/main.py
index 16b60a2..a2e109a 100644
--- a/homu/main.py
+++ b/homu/main.py
@@ -649,7 +649,7 @@ def git_push(git_cmd, branch, state):
def init_local_git_cmds(repo_cfg, git_cfg):
- fpath = 'cache/{}/{}'.format(repo_cfg['owner'], repo_cfg['name'])
+ fpath = '{}/cache/{}/{}'.format(os.path.expanduser("~"), repo_cfg['owner'], repo_cfg['name'])
url = 'git@github.com:{}/{}.git'.format(repo_cfg['owner'], repo_cfg['name']) # noqa
if not os.path.exists(SSH_KEY_FILE):

View File

@ -1,34 +0,0 @@
{ python3Packages, python3, fetchFromGitHub, git, openssh }:
let
uritemplate_0_2_0 = python3Packages.github3_py.overrideAttrs(oa: rec {
version = "0.2.0";
src = python3Packages.fetchPypi {
pname = "uritemplate.py";
inherit version;
sha256 = "1pfk04pmnysz0383lwzgig8zqlwiv2n4pmq51f0mc60zz1jimq4g";
};
});
github3_py_0_9_6 = python3Packages.github3_py.overrideAttrs(oa: rec {
version = "0.9.6";
src = python3Packages.fetchPypi {
pname = "github3.py";
inherit version;
sha256 = "1i8xnh586z4kka7pjl7cy08fmzjs14c8jdp8ykb9jjpzsy2xncdq";
};
propagatedBuildInputs = [ python3Packages.requests uritemplate_0_2_0 ];
});
in
python3Packages.buildPythonApplication {
name = "homu";
src = fetchFromGitHub {
owner = "servo";
repo = "homu";
rev = "2ea53e76ebac3e5fa11bc39054b3cd4c42eff607";
sha256 = "1ih7s8zfbpq0qb9vqbxzr0r4s9ff52l4ipr916kwbck3ygliq3r9";
};
patches = [ ./patch-cache-directory.patch ./disable-ssh-host-keycheck.patch ];
postInstall = "chmod 755 $out/${python3.sitePackages}/homu/git_helper.py";
propagatedBuildInputs = [ github3_py_0_9_6 git openssh ] ++ (with python3Packages; [ toml jinja2 requests bottle waitress retrying ]);
checkPhase = "python -m unittest discover tests -v";
}

View File

@ -1,47 +0,0 @@
commit 5aa5f8d5742883d41d7278a2c8bc2c9a2ddfef45
Author: Sebastien Bourdeauducq <sb@m-labs.hk>
Date: Sun Apr 14 18:25:27 2019 +0800
add SVG icon for conda package
diff --git a/src/root/product-list.tt b/src/root/product-list.tt
index 298d0a66..85914bbd 100644
--- a/src/root/product-list.tt
+++ b/src/root/product-list.tt
@@ -157,6 +157,11 @@
<img src="[% c.uri_for("/static/images/debian.png") %]" alt="DEB" />
</td>
<td>Debian package</td>
+ [% CASE "conda" %]
+ <td>
+ <img src="[% c.uri_for("/static/images/conda.svg") %]" width="32" height="32" alt="Conda" />
+ </td>
+ <td>Conda package</td>
[% CASE "iso" %]
<td>
<img src="[% c.uri_for("/static/images/iso.png") %]" alt="ISO" />
diff --git a/src/root/static/images/conda.svg b/src/root/static/images/conda.svg
new file mode 100644
index 00000000..67859731
--- /dev/null
+++ b/src/root/static/images/conda.svg
@@ -0,0 +1,18 @@
+<svg width="128" height="128" style="enable-background:new 0 0 128 128;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <g id="g2">
+ <g>
+ <path d="M118.89,75.13c-1.31-2.72-3.46-5.53-6.97-7.33c-2.37-1.48-4.57-2.24-6.01-2.63 c1.53-5.6-0.64-10.06-3.69-13.39c-4.53-4.88-9.27-5.59-9.27-5.59l-0.01,0c1.56-3.03,2.15-6.54,1.36-9.99 c-1-4.26-3.29-6.94-6.31-8.73c-3.09-1.83-6.91-2.73-10.83-3.43c-1.88-0.34-9.81-1.45-13.1-6c-2.65-3.69-2.73-10.33-3.45-12.32 c-0.77-2.05-3.38-1.15-6.23,0.76c-3.33,2.22-10.23,9.35-12.89,16.49c-2.03,5.47-2.08,10.21-1.28,13.89 c-3.29,0.55-5.76,1.66-6.23,1.88c-0.16,0.05-0.32,0.1-0.49,0.17c-3.01,1.24-9.43,7.02-10.01,15.85c-0.2,3.14,0.21,6.31,1.2,9.26 c-3.94,1.1-6.22,2.54-6.26,2.57c-2,0.75-5.18,2.95-6.15,4.13c-1.97,2.38-3.34,5.21-4.15,8.18C6.35,85.36,7,92.71,10.14,98.67 c1.74,3.31,4.12,6.83,6.74,9.52c8.55,8.79,23.31,12.11,34.96,14.03c14.19,2.34,29.05,1.52,42.33-3.97 c19.92-8.22,25.22-21.44,26-25.17C121.92,84.77,119.8,77,118.89,75.13z" style="fill:#865D53;"/>
+ <g>
+ <g>
+ <ellipse cx="85.95" cy="66.39" rx="16.61" ry="15.5" style="fill:#FFFFFF;" transform="matrix(0.1106 -0.9939 0.9939 0.1106 10.453 144.4706)"/>
+ <path d="M92.63,66.36c-0.23,3.3-3.14,5.82-6.49,5.62c-3.36-0.19-5.9-3.04-5.67-6.34 c0.22-3.31,3.12-5.82,6.48-5.62C90.31,60.21,92.86,63.06,92.63,66.36" style="fill:#2F2F2F;"/>
+ </g>
+ <g>
+ <ellipse cx="42.46" cy="66.4" rx="15.5" ry="16.61" style="fill:#FFFFFF;" transform="matrix(0.9972 -0.0752 0.0752 0.9972 -4.8714 3.3796)"/>
+ <path d="M49.02,65.13c0.38,3.29-2.01,6.3-5.34,6.72c-3.34,0.43-6.36-1.9-6.74-5.18 c-0.4-3.29,1.99-6.3,5.33-6.73C45.6,59.52,48.63,61.85,49.02,65.13" style="fill:#2F2F2F;"/>
+ </g>
+ </g>
+ <path d="M87.35,89.46c-2.22-1.5-5.02-0.51-7.49,0c-6.9,1.42-12.95,1.48-15.86,1.48 c-2.91,0-8.96-0.06-15.86-1.48c-2.47-0.51-5.27-1.5-7.49,0c-2.82,1.9-0.74,8.74,3.7,13.36c2.68,2.79,9.07,8.21,19.66,8.21 c10.58,0,16.97-5.42,19.66-8.21C88.09,98.2,90.17,91.37,87.35,89.46z" style="fill:#ED6D31;"/>
+ </g>
+ </g>
+</svg>
\ No newline at end of file

View File

@ -1,19 +0,0 @@
commit 86bf81c0b8a51bffa4b4b566e1caaac6f0e041d3
Author: Sebastien Bourdeauducq <sb@m-labs.hk>
Date: Thu Mar 14 17:45:32 2019 +0800
add option to disable retries on transient failures
diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc
index 69c430eb..bdbc808d 100644
--- a/src/hydra-queue-runner/build-remote.cc
+++ b/src/hydra-queue-runner/build-remote.cc
@@ -344,7 +344,7 @@ void State::buildRemote(ref<Store> destStore,
break;
case BuildResult::TransientFailure:
result.stepStatus = bsFailed;
- result.canRetry = true;
+ result.canRetry = get(step->drv.env, "__hydraRetry", "1") == "1";
result.errorMsg = "";
break;
case BuildResult::TimedOut:

View File

@ -1,14 +0,0 @@
diff -Naur matterbridge-1.11.0.orig/bridge/mattermost/mattermost.go matterbridge-1.11.0/bridge/mattermost/mattermost.go
--- matterbridge-1.11.0.orig/bridge/mattermost/mattermost.go 2018-06-19 06:28:16.000000000 +0800
+++ matterbridge-1.11.0/bridge/mattermost/mattermost.go 2019-04-26 20:40:11.831475087 +0800
@@ -444,6 +444,10 @@
return true
}
+ if message.Username == "github" {
+ return true
+ }
+
// if the message has reactions don't repost it (for now, until we can correlate reaction with message)
if message.Post.HasReactions {
return true

View File

@ -1,32 +0,0 @@
{ fetchFromGitHub, python3Packages }:
with python3Packages;
buildPythonPackage rec {
pname = "mattermost-github-integration";
version = "0.0.0-unstable";
src = fetchFromGitHub {
owner = "softdevteam";
repo = "mattermost-github-integration";
rev = "master";
sha256 = "1hfvjaxjhliy8sv9j3616fkdwd2jqhfsj9ai7ggx88zhxknrfx85";
};
propagatedBuildInputs = [
appdirs
click
flask
itsdangerous
jinja2
markupsafe
olefile
packaging
pillow
pyparsing
requests
six
werkzeug
];
checkInputs = [
pytest
];
doCheck = true;
}

View File

@ -1,15 +0,0 @@
{ config, pkgs }:
let
pkg = pkgs.callPackage ./pkg.nix {};
in {
type = "normal";
pythonPackages = self: [ pkg ];
module = "mattermostgithub:app";
env = [
"MGI_CONFIG_FILE=${./../secret/mattermost-github-integration.py}"
];
socket = "${config.services.uwsgi.runDir}/uwsgi.sock";
# allow access from nginx
chmod-socket = 666;
}

View File

@ -1,111 +0,0 @@
From e2015bbfcbcf7594824755e39f838d7aab258b6e Mon Sep 17 00:00:00 2001
From: Graham Christensen <graham@grahamc.com>
Date: Sat, 13 May 2017 08:53:07 -0400
Subject: [PATCH] Support multiple versions of nixpkgs in one network
Having a machine named foo, described as:
foo = { # ...snipped...
deployment.nix_path.nixpkgs = (builtins.filterSource
(path: type: type != "directory" || baseNameOf path != ".git")
./../nixpkgs);
});
will have the custom nixpkgs set in the `NIX_PATH` as
`nixpkgs=path-to-custom-nixpkgs`.
Note this does not work with foo = { config, ... }: {... machines, but
having a second nix file in the network would work, and also:
let
canary = machine: {
deployment.nix_path.nixpkgs = (builtins.filterSource
(path: type: type != "directory" || baseNameOf path != ".git")
./../nixpkgs);
imports = [machine];
};
machine = { ... }: {
# your machine config
};
in {
machineA = machine;
machineB = canary machine;
}
Note that because this uses scopedImport, the nixops network and
machines may use `import <nixpkgs>` and have a consistent view of
nixpkgs.
---
nix/eval-machine-info.nix | 35 ++++++++++++++++++++++++++++++++---
nix/options.nix | 7 +++++++
2 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/nix/eval-machine-info.nix b/nix/eval-machine-info.nix
index 503b4c25d..085452cd4 100644
--- a/nix/eval-machine-info.nix
+++ b/nix/eval-machine-info.nix
@@ -39,13 +39,42 @@ rec {
# Get the configuration of this machine from each network
# expression, attaching _file attributes so the NixOS module
# system can give sensible error messages.
+
modules =
concatMap (n: optional (hasAttr machineName n)
{ imports = [(getAttr machineName n)]; inherit (n) _file; })
networks;
- in
- { name = machineName;
- value = import <nixpkgs/nixos/lib/eval-config.nix> {
+
+ machineConfs =
+ concatMap (n: optional (hasAttr machineName n)
+ (getAttr machineName n))
+ networks;
+
+ nameToPath = attrs: name: {
+ prefix = name;
+ path = attrs."${name}";
+ };
+
+ attrsetToPaths = attrset: map (nameToPath attrset)
+ (builtins.attrNames attrset);
+
+ importSources =
+ (concatMap (module:
+ if (!builtins.isFunction module
+ && builtins.hasAttr "deployment" module)
+ && (builtins.hasAttr "nix_path" module.deployment)
+ then attrsetToPaths module.deployment.nix_path
+ else [])
+ machineConfs) ++ builtins.nixPath;
+
+ __nixPath = importSources;
+
+ machineImport = builtins.scopedImport {
+ inherit __nixPath;
+ };
+ in {
+ name = machineName;
+ value = machineImport <nixpkgs/nixos/lib/eval-config.nix> {
modules =
modules ++
defaults ++
diff --git a/nix/options.nix b/nix/options.nix
index 0866c3ab8..117b44a7b 100644
--- a/nix/options.nix
+++ b/nix/options.nix
@@ -103,6 +103,13 @@ in
'';
};
+ deployment.nix_path = mkOption {
+ default = {};
+ type = types.attrsOf types.str;
+ description = ''
+ '';
+ };
+
deployment.hasFastConnection = mkOption {
default = false;
type = types.bool;

View File

@ -1,93 +0,0 @@
{ config, pkgs, lib, ... }:
with lib;
let
notifico = (pkgs.callPackage ./pkg.nix {})
.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ pkgs.makeWrapper ];
# Extend the module path so that local_config.py can be found
postInstall = ''
${attrs.postInstall}
wrapProgram $out/bin/notifico \
--set PYTHONPATH "$${PYTHONPATH}:${cfg.dbDir}"
'';
});
cfg = config.services.notifico;
in
{
options.services.notifico = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the commit notification service";
};
enableLocalRedis = mkOption {
type = types.bool;
default = true;
description = "Enable a local Redis server";
};
dbDir = mkOption {
type = types.str;
default = "/var/db/notifico";
description = "Home directory and location of the database file";
};
config = mkOption {
description = "Path to local_config.py, https://github.com/notifico/notifico/raw/master/notifico/config.py";
type = types.str;
};
};
config = mkIf cfg.enable {
users.users.notifico = {
group = "notifico";
home = cfg.dbDir;
createHome = true;
};
users.groups.notifico = {};
services.redis = mkIf cfg.enableLocalRedis {
enable = true;
bind = "127.0.0.1";
};
systemd.services =
let
User = "notifico";
Group = "notifico";
WorkingDirectory = "${cfg.dbDir}";
ExecStartPre = [
"${pkgs.coreutils}/bin/rm -f local_config.pyc"
"${pkgs.coreutils}/bin/ln -sf ${cfg.config} local_config.py"
];
notifico-init = {
description = "Notifico initialization";
serviceConfig = {
inherit User Group WorkingDirectory ExecStartPre;
Type = "oneshot";
ExecStart = "${notifico}/bin/notifico init";
};
};
notificoService = component: {
description = "Notifico ${component}";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "notifico-init.service" ];
requires = [ "notifico-init.service" ];
serviceConfig = {
inherit User Group WorkingDirectory ExecStartPre;
Type = "simple";
ExecStart = "${notifico}/bin/notifico ${component}";
Restart = "always";
RestartSec = "5sec";
};
};
in {
inherit notifico-init;
notifico-www = notificoService "www";
notifico-worker = notificoService "worker";
notifico-bots = notificoService "bots";
};
};
}

View File

@ -1,107 +0,0 @@
{ python2Packages, python2, fetchFromGitHub, fetchurl }:
let
Flask-Gravatar = python2Packages.buildPythonPackage {
name = "Flask-Gravatar";
src = python2Packages.fetchPypi {
pname = "Flask-Gravatar";
version = "0.5.0";
sha256 = "1qb2ylirjajdqsmldhwfdhf8i86k7vlh3y4gnqfqj4n6q8qmyrk0";
};
propagatedBuildInputs = with python2Packages; [
pytestrunner
flask
];
checkInputs = with python2Packages; [
check-manifest
coverage
isort
pydocstyle
pytestcache
pytestcov
pytestpep8
pytest
pygments
];
};
utopia = python2Packages.buildPythonPackage {
name = "utopia";
src = fetchFromGitHub {
owner = "notifico";
repo = "utopia";
rev = "70293ed5e1ca55232e0fae71061e7e9b9b29be6f";
sha256 = "11cnh9l4d9jlhafnfis9si6kgk9zsdd5439qnhxh6dca3x4a986q";
};
propagatedBuildInputs = with python2Packages; [
gevent
blinker
];
doCheck = false;
};
Flask-WTF = python2Packages.flask_wtf.overrideAttrs(oa: rec {
version = "0.8.4";
src = python2Packages.fetchPypi {
pname = "Flask-WTF";
inherit version;
sha256 = "1khbwmlrcnk9f46f7kf531n06pkyfs6nc8fk273js9mj2igngg2y";
};
});
Flask-XML-RPC = python2Packages.flask_wtf.overrideAttrs(oa: rec {
version = "0.1.2";
src = python2Packages.fetchPypi {
pname = "Flask-XML-RPC";
inherit version;
sha256 = "1dwalj7pc5iid9l1k50q5mllirnn9f5s7jq54a66x48a4j179p2a";
};
});
in
python2Packages.buildPythonApplication {
name = "notifico";
src = fetchFromGitHub {
owner = "notifico";
repo = "notifico";
rev = "6af849e4c75dff4d740051676f5a2093a44efcee";
sha256 = "18jifqdvjy4x5s1bh7vx501pin52g4n3hhw1z4m2c0h512z4spdr";
};
patches = [
(fetchurl {
url = https://github.com/whitequark/notifico/commit/22b582fad6cb97af6f7437e8462d720ddacc42ef.patch;
sha256 = "0w8i8hf1r8b0p1y1zn9vyvnyi20qp120aiyalqymhsxsh17mma52";
})
];
propagatedBuildInputs = with python2Packages; [
flask
Flask-WTF
Flask-Gravatar
flask_sqlalchemy
Flask-XML-RPC
flask_mail
flask-caching
Fabric
sqlalchemy
utopia
gevent
oauth2
redis
gunicorn
requests
PyGithub
xmltodict
unidecode
raven
blinker
docopt
celery
];
postInstall = ''
mkdir $out/bin
cat << EOF > $out/bin/notifico
#!${python2}/bin/python
import sys
from notifico.__main__ import main
sys.exit(main(sys.argv))
EOF
chmod +x $out/bin/notifico
'';
}

View File

@ -1,11 +0,0 @@
-rw------- 1 root root backup-passphrase
-rw------- 1 root root email_accounts.nix
-rw------- 1 homu homu homu.toml
-rw-rw---- 1 gitea gitea mailerpassword
-rw------- 1 matterbridge matterbridge matterbridge.toml
-rw------- 1 uwsgi uwsgi mattermost-github-integration.py
-rw------- 1 nginx nginx muninpasswd
-rw-rw---- 1 hydra hydra nixbld.m-labs.hk-1
-rw-rw---- 1 hydra hydra nix_id_rsa
-rw------- 1 root root rclone.conf
-rw------- 1 root root wifi_password.nix

View File

@ -1,102 +0,0 @@
{ host }:
{ config, pkgs, ... }:
{
deployment.targetHost = host;
imports =
[
(./. + "/${host}-hardware-configuration.nix")
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = host;
time.timeZone = "Asia/Hong_Kong";
# List packages installed in system profile. To search, run:
# $ nix search wget
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
wget vim git firefox thunderbird hexchat usbutils pciutils mplayer vlc youtube-dl file lm_sensors cryptsetup audacious acpi
gwenview okular gimp imagemagick
(python3.withPackages(ps: with ps; [ numpy scipy matplotlib qtconsole pypdf2 reportlab pygments regex ]))
texlive.combined.scheme-full mosh psmisc libreoffice-fresh
xc3sprog gtkwave xournal xsane telnet whois transmission-gtk unzip zip inkscape tigervnc gnupg
wireshark qrencode yosys symbiyosys yices z3 boolector cvc4 pavucontrol keepassx poppler_utils
jq ark sublime3 rink qemu_kvm konsole
];
services.openssh.enable = true;
services.openssh.forwardX11 = true;
# Enable CUPS to print documents.
services.printing = {
enable = true;
};
services.avahi = {
enable = true;
nssmdns = true;
};
# Enable sound.
sound.enable = true;
hardware.pulseaudio = {
enable = true;
extraModules = [ pkgs.pulseaudio-modules-bt ];
package = pkgs.pulseaudioFull;
};
i18n.inputMethod = {
enabled = "fcitx";
fcitx.engines = with pkgs.fcitx-engines; [ table-extra m17n ];
};
fonts.fonts = [ pkgs.noto-fonts pkgs.noto-fonts-cjk pkgs.noto-fonts-emoji pkgs.noto-fonts-extra ];
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.layout = "us";
services.xserver.xkbOptions = "eurosign:e";
# Enable touchpad support.
services.xserver.libinput.enable = true;
# Enable the KDE Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.autoLogin.enable = true;
services.xserver.displayManager.sddm.autoLogin.user = "harry";
services.xserver.desktopManager.plasma5.enable = true;
hardware.bluetooth.enable = true;
programs.fish.enable = true;
users.defaultUserShell = pkgs.fish;
users.extraGroups.plugdev = { };
users.extraUsers.sb = {
isNormalUser = true;
extraGroups = ["wheel" "plugdev" "dialout"];
};
users.extraUsers.harry = {
isNormalUser = true;
extraGroups = ["plugdev" "dialout"];
};
security.sudo.wheelNeedsPassword = false;
services.udev.packages = [ pkgs.openocd pkgs.hackrf ];
services.udev.extraRules = ''
ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple"
ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple"
'';
nix.binaryCachePublicKeys = ["nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="];
nix.binaryCaches = ["https://nixbld.m-labs.hk" "https://cache.nixos.org"];
nix.sandboxPaths = ["/opt"];
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.03"; # Did you read the comment?
}

View File

@ -1,30 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/62a38d9c-452c-4648-be12-6131e95b8276";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/88F6-46F2";
fsType = "vfat";
};
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}

View File

@ -1,13 +0,0 @@
{
rpi-1 = import ./rpi.nix { host = "rpi-1"; rpi4 = false; };
rpi-2 = import ./rpi.nix { host = "rpi-2"; rpi4 = false; };
rpi-3 = {
deployment.nix_path.nixpkgs = "https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz";
imports = [(import ./rpi.nix { host = "rpi-3"; rpi4 = true; })];
};
rpi-4 = {
deployment.nix_path.nixpkgs = "https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz";
imports = [(import ./rpi.nix { host = "rpi-4"; rpi4 = true; })];
};
juno = import ./desktop.nix { host = "juno"; };
}

View File

@ -1,90 +0,0 @@
{ host, rpi4 }:
{ config, pkgs, ... }:
let
m-labs = import (fetchTarball https://nixbld.m-labs.hk/channel/custom/artiq/full/artiq-full/nixexprs.tar.xz) { inherit pkgs; };
in
{
deployment.targetHost = host;
nixpkgs.system = "aarch64-linux";
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = !rpi4;
boot.loader.raspberryPi = pkgs.lib.mkIf rpi4 {
enable = true;
version = 4;
};
boot.kernelPackages = pkgs.lib.mkIf rpi4 pkgs.linuxPackages_rpi4;
fileSystems = if rpi4 then {
"/boot" = {
device = "/dev/disk/by-label/FIRMWARE";
fsType = "vfat";
};
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
} else {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
};
services.openssh.enable = true;
networking.hostName = host;
time.timeZone = "Asia/Hong_Kong";
programs.wireshark.enable = true;
users.extraUsers.nix = {
isNormalUser = true;
};
users.extraGroups.plugdev = { };
security.sudo.wheelNeedsPassword = false;
users.extraUsers.sb = {
isNormalUser = true;
extraGroups = ["wheel" "plugdev" "dialout"];
openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZGtCJoIRtRadaSBMx+MNX53nvEGUk9q/89ZpEH/jCRS+FRnBOH73C8YGvsJaiL5xUZiLjIW7SRUr40bKgvns1FJ3PNMPqvAh6fC98h5EnWAVtzKpYVXGPVvxGOqRJwvEHr6DGMJbP1lRl78zFt3PQaeEiJ5mCxlY4KenKbkBJpUWBAUa11VrNd+o7AMfF0pbNDxZCd213brbyb8saLnEx28HwdaUn//MMWnfSPDLGlod5dy4/hzj0Yk/o+4yaeIkfk1Z0FqtZif1N+VTqD5r0dfvIi38mmVYzbImy5X/hoPtLTMRb//6KZH5POwMP3ZazIq7Bl0cmGfDEu/p6/zJd sb@sb-ThinkPad-10"];
};
users.extraUsers.astro = {
isNormalUser = true;
extraGroups = ["plugdev" "dialout" "wireshark"];
openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGJJTSJdpDh82486uPiMhhyhnci4tScp5uUe7156MBC8 a"];
};
users.extraUsers.harry = {
isNormalUser = true;
extraGroups = ["plugdev" "dialout"];
openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfZGegJYOV2qCdTf2R54thWt0UjH/ycarugV5UWrdql7w9yqaGwqeadRIVoz9IH++AB8NFxPzxMiQzOH5TI4r5hVjconslSeucMvh9u/GPJqQk94uZayodgfqCeBL5v8RqW4kJE1CHrSbKhzLrtWsTsju2XFidLGqBg1v7HWmSB6UqzqmQWqPLxDCi7/JW2ECuKjYlOJY+uzGFz5cxOtJO/lUNSXT3ZSWF/VLscuMmLsdyocdVwZANgPS7A0/wArlbZZMNw72CHuWsh8WVxarKIRwhoaBgXv7Oj3ohi6fVRGo1DOC3ucDGCDNjaQG2gbXGHEiPtrpz43I7BcCeJqNH harry@juno"];
};
users.extraUsers.florent = {
isNormalUser = true;
extraGroups = ["plugdev" "dialout"];
openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDH3zGbV5zlJ2V8IsFkD2G8xpm03RsPCRKpvS5WLonogpfUO91zcgX1NVikNqB+EsyUvDtXBVu38esh31hoafXx050mqP6vtmjau4yBYOM0Z1Cp07b1oCQhMgeqkV3k2TJ69S5/fTzUYnneEv5yNhOPJucKwdDBqVdN1k/EEYx7WAlPSnpmnYB5xYlx+wB3YweNf9zFi3+4oadIYyKkdRD6+2HqqLxUVs4gVqVGilCIc4keMyrfOSmcK5MPPfhat+42WAkwZic26HJfZlQXujSPuMUnzizJ2BNUH5feDylkPCsSFJrhqoCvRESVaARAIb20IPo43qxN5YspqSzn4LV1frMjW66u/gl5X9psMEIsfNNUQ/KtKB70BzeRTJbIQY3FkKohLINPFKP76aPOvFx+T3MNvQ4MN/baqTPd8wnwggQa/srmdh/TBi2xeiOu83IRhhoy0gDRsrYipsuleVv8+xY1wEopFzVGG0iYrBueXDMuT8VSvgfh/REEqi7grp2RaG3GnkcWLWCARdsnPoaHPc5SANaKCwnxUalm79DHN1TzG/GNTwU2TXxCwCCNyD0E6oY5a5bByTC00e5mBRX0CqQTAlUacdztKb28kcGCOXb3kp//OD2O/yrca1tNqc/dF5y8LDMqEpy7EXQdK6kjiKeBnUjkAzmZ7y38PX5WHw== florent@enjoy-digital.fr"];
};
users.extraUsers.jerry = {
isNormalUser = true;
extraGroups = ["plugdev" "dialout"];
openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1vcq23Z221/OoiXombiXJYzQNTlgtWTXSnBI1jRDgcOfEX993jGIcC6NAa4czeqKu6kqEo+dqGMO872lPTo57KcBNmev+2J+WfvrRRu5uCkMcYWPA6peQq9VJ3+/YT8uShYN8KeDnlfuER8KrDo5RKX+SWk0NSgMXwdW5HD6bmRac1K6kydB+IGrltyUpph37vJEzF+OxPySiLQhWrwSQERYya+3fI/NsilffYa5qoDFmEfKwaSLIJ9zLbhTR7UPc0loQjyICOlGempbHwKK1YZJfidGIf5pHsW3wT3EnJzbMliQspXkw0KZyZij529TnoQkjGEsAsHI1es92/VP5 jerry@jerry-VivoBook-Flip-14-TP410UF"];
};
users.extraUsers.sjm = {
isNormalUser = true;
extraGroups = ["plugdev" "dialout"];
openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPqBya2nrq39Jl/eguA4LcfvT5ishB1gBE7ofkUbd/+Q sjm@fractalide.com"];
};
services.udev.packages = [ m-labs.openocd ];
documentation.enable = false;
environment.systemPackages = with pkgs; [
psmisc wget vim git usbutils lm_sensors file telnet mosh tmux xc3sprog m-labs.openocd screen gdb minicom picocom
];
nix.binaryCachePublicKeys = ["nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="];
nix.binaryCaches = ["https://cache.nixos.org" "https://nixbld.m-labs.hk"];
nix.trustedUsers = ["root" "nix"];
}

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ let
rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix { rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix {
inherit rustManifest; inherit rustManifest;
}); });
buildStm32Firmware = { name, src }: buildStm32Firmware = { name, src, patchPhase ? "" }:
let let
cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''cp "${src}/cargosha256.nix" $out''; cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''cp "${src}/cargosha256.nix" $out'';
in in
@ -19,6 +19,7 @@ let
inherit src; inherit src;
cargoSha256 = (import cargoSha256Drv); cargoSha256 = (import cargoSha256Drv);
inherit patchPhase;
buildPhase = '' buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX) export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo build --release cargo build --release
@ -36,6 +37,11 @@ in
stabilizer = buildStm32Firmware { stabilizer = buildStm32Firmware {
name = "stabilizer"; name = "stabilizer";
src = <stabilizerSrc>; src = <stabilizerSrc>;
patchPhase = ''
substituteInPlace src/main.rs \
--replace "let local_addr = net::wire::IpAddress::v4(10, 0, 16, 99);" \
"let local_addr = net::wire::IpAddress::v4(192, 168, 1, 76);"
'';
}; };
thermostat = buildStm32Firmware { thermostat = buildStm32Firmware {
name = "thermostat"; name = "thermostat";

59
zynq.nix Normal file
View File

@ -0,0 +1,59 @@
let
pkgs = import <nixpkgs> {};
zc706 = import <zc706> { mozillaOverlay = import <mozillaOverlay>; };
artiq-zynq = import <artiq-zynq> { mozillaOverlay = import <mozillaOverlay>; };
artiq-fast = import <artiq-fast> { inherit pkgs; };
addBuildProducts = drv: drv.overrideAttrs (oldAttrs: {
installPhase = ''
${oldAttrs.installPhase}
mkdir -p $out/nix-support
for f in $out/*.elf ; do
echo file binary-dist $f >> $out/nix-support/hydra-build-products
done
'';
});
in
(
builtins.mapAttrs (name: drv:
pkgs.lib.hydraJob (
addBuildProducts drv
)
) zc706.zc706
) // (
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiq-zynq
) // {
zc706-hitl-tests = pkgs.lib.hydraJob (pkgs.stdenv.mkDerivation {
name = "zc706-hitl-tests";
# requires patched Nix
__networked = true;
buildInputs = [
pkgs.netcat pkgs.openssh pkgs.rsync artiq-fast.artiq
];
phases = [ "buildPhase" ];
buildPhase =
''
echo Power cycling board...
(echo b; sleep 5; echo B) | nc -N 192.168.1.31 3131
sleep 5
echo Power cycle done.
export USER=hydra
pushd ${<artiq-zynq>}
bash ${<artiq-zynq>}/remote_run.sh -h rpi-4 -o "-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i /opt/hydra_id_rsa" -d ${artiq-zynq.zc706-simple-jtag}
popd
echo Waiting for the firmware to boot...
sleep 15
echo Running test kernel...
artiq_run --device-db ${<artiq-zynq>}/examples/device_db.py ${<artiq-zynq>}/examples/mandelbrot.py
touch $out
echo Completed
'';
});
}