-
Notifications
You must be signed in to change notification settings - Fork 0
/
dax_flake_sample
95 lines (93 loc) · 3.5 KB
/
dax_flake_sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
inputs = {
artiqpkgs.url = git+https://github.com/m-labs/artiq?ref=release-7;
nixpkgs.follows = "artiqpkgs/nixpkgs";
sipyco.follows = "artiqpkgs/sipyco";
flake8-artiq = {
url = git+https://gitlab.com/duke-artiq/flake8-artiq.git;
inputs.artiqpkgs.follows = "artiqpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
artiq-stubs = {
url = git+https://gitlab.com/duke-artiq/artiq-stubs.git;
inputs.artiqpkgs.follows = "artiqpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
trap-dac-utils = {
url = git+https://gitlab.com/duke-artiq/trap-dac-utils.git;
inputs.artiqpkgs.follows = "artiqpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, artiqpkgs, sipyco, flake8-artiq, artiq-stubs, trap-dac-utils }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
# get major version from ARTIQ
daxVersionBase = builtins.elemAt (builtins.splitVersion artiqpkgs.packages.x86_64-linux.artiq.version) 0;
daxVersion = daxVersionBase + "." + (builtins.toString self.sourceInfo.revCount or 0) + "." + (self.sourceInfo.shortRev or "unknown");
dax = (with pkgs; python3Packages.buildPythonPackage rec {
pname = "dax";
version = daxVersion;
src = nix-gitignore.gitignoreSource [ "*.nix" ] ./.;
VERSIONEER_OVERRIDE = version;
inherit (python3Packages.pygit2) SSL_CERT_FILE;
propagatedBuildInputs = (
(with python3Packages; [ numpy scipy pyvcd natsort pygit2 matplotlib graphviz h5py networkx sortedcontainers ]) ++
[ artiqpkgs.packages.x86_64-linux.artiq sipyco.packages.x86_64-linux.sipyco trap-dac-utils.packages.x86_64-linux.trap-dac-utils ]
);
checkInputs = with python3Packages; [ pytestCheckHook ];
condaDependencies = [
"python>=3.7"
"trap-dac-utils"
"artiq"
"sipyco"
"numpy"
"scipy"
"pyvcd"
"natsort"
"pygit2"
"matplotlib"
"python-graphviz"
"h5py"
"networkx"
"sortedcontainers"
];
meta = with lib; {
description = "Duke ARTIQ Extensions (DAX)";
maintainers = [ "Duke University" ];
homepage = "https://gitlab.com/duke-artiq/dax";
license = licenses.asl20;
};
});
in
rec {
packages.x86_64-linux = {
inherit dax;
flake8-artiq = flake8-artiq.packages.x86_64-linux.flake8-artiq;
artiq-stubs = artiq-stubs.packages.x86_64-linux.artiq-stubs;
default = pkgs.python3.withPackages (ps: [ dax ]);
};
# default shell for `nix develop`
devShells.x86_64-linux.default = pkgs.mkShell {
name = "dax-dev-shell";
buildInputs = [
(pkgs.python3.withPackages (ps:
# basic environment
dax.propagatedBuildInputs ++
# test dependencies
(with ps; [ pytest mypy pycodestyle coverage ]) ++
([ packages.x86_64-linux.flake8-artiq packages.x86_64-linux.artiq-stubs ])
))
];
};
# enables use of `nix fmt`
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
};
nixConfig = {
extra-trusted-public-keys = [
"build-mblab.duckdns.org:PKlwT12HTBdsh4MyiDoMj/zTUA6f0vi2hzLa6tYoEpM="
"nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="
];
extra-substituters = [ "http://build-mblab.duckdns.org" "https://nixbld.m-labs.hk" ];
};
}