-
Notifications
You must be signed in to change notification settings - Fork 48
/
default.nix
102 lines (80 loc) · 2.24 KB
/
default.nix
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
94
95
96
97
98
99
100
101
102
# Nix expression for building Tockloader
{ pkgs ? import <nixpkgs> {}, withUnfreePkgs ? true }:
with builtins;
let
inherit (pkgs) stdenv stdenvNoCC lib;
nrf-command-line-tools = stdenvNoCC.mkDerivation {
pname = "nrf-command-line-tools";
version = "10.22.1";
src = builtins.fetchurl {
url = "https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-22-1/nrf-command-line-tools-10.22.1_linux-amd64.tar.gz";
sha256 = "sha256:0i3dfhp75rizs7kxyfka166k3zy5hmb28c25377pgnzk6w1yx383";
};
nativeBuildInputs = with pkgs; [
autoPatchelfHook
];
propagatedBuildInputs = with pkgs; [
segger-jlink libusb
];
installPhase = ''
mkdir -p $out/
cp -r * $out/
'';
meta.license = lib.licenses.unfree;
};
python3Packages = lib.fix' (self: with self; pkgs.python3Packages //
{
siphash = buildPythonPackage rec {
pname = "siphash";
version = "0.0.1";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-rul/6V4JoplYGcBYpeSsbZZmGomNf+CtVeO3LJox1GE=";
};
};
pynrfjprog = buildPythonPackage {
pname = "pynrfjprog";
version = nrf-command-line-tools.version;
src = nrf-command-line-tools.src;
preConfigure = ''
cd ./python
'';
format = "pyproject";
nativeBuildInputs = [
setuptools
pkgs.autoPatchelfHook
];
buildInputs = [
nrf-command-line-tools
];
propagatedBuildInputs = [
tomli-w
future
];
meta.license = lib.licenses.unfree;
};
});
in pkgs.python3Packages.buildPythonPackage rec {
pname = "tockloader";
version = "1.10.0";
name = "${pname}-${version}";
propagatedBuildInputs = with python3Packages; [
argcomplete
colorama
crcmod
pyserial
toml
tqdm
questionary
pycrypto
siphash
] ++ (lib.optional withUnfreePkgs pynrfjprog);
src = ./.;
# Dependency checks require unfree software
doCheck = withUnfreePkgs;
# Make other dependencies explicitly available as passthru attributes
passthru = {
inherit nrf-command-line-tools;
pynrfjprog = python3Packages.pynrfjprog;
};
}