forked from tock/libtock-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
58 lines (51 loc) · 1.27 KB
/
shell.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
# Shell expression for the Nix package manager
#
# This nix expression creates an environment with necessary packages installed:
#
# * `tockloader`
# * arm-none-eabi toolchain
# * elf2tab
#
# To use:
#
# $ nix-shell
#
{ pkgs ? import <nixpkgs> {} }:
with builtins;
let
inherit (pkgs) stdenv;
pythonPackages = stdenv.lib.fix' (self: with self; pkgs.python3Packages //
{
tockloader = buildPythonPackage rec {
pname = "tockloader";
version = "1.6.0";
name = "${pname}-${version}";
propagatedBuildInputs = [ argcomplete colorama crcmod pyserial pytoml ];
src = fetchPypi {
inherit pname version;
sha256 = "1aqkj1nplcw3gmklrhq6vxy6v9ad5mqiw4y1svasak2zkqdk1wyc";
};
};
});
elf2tab = pkgs.rustPlatform.buildRustPackage rec {
name = "elf2tab-${version}";
version = "0.6.1";
src = pkgs.fetchFromGitHub {
owner = "tock";
repo = "elf2tab";
rev = "v${version}";
sha256 = "1illr6shr1nvq9w0h9ixkabi2r2hm5k5kpxw67yah5cd66cqipzj";
};
cargoSha256 = "1lqdlv11p831ych9q1ji7y4gjz6z4prsy928jzd2vy2k0mg215vj";
};
in
with pkgs;
stdenv.mkDerivation {
name = "tock-dev";
buildInputs = [
elf2tab
gcc-arm-embedded
python3Full
pythonPackages.tockloader
];
}