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.3.1";
name = "${pname}-${version}";
propagatedBuildInputs = [ argcomplete colorama crcmod pyserial pytoml ];
src = fetchPypi {
inherit pname version;
sha256 = "1gralnhvl82xr7rkrmxj0c1rxn1y9dlbmkkrklcdjahragbknivn";
};
};
});
elf2tab = pkgs.rustPlatform.buildRustPackage rec {
name = "elf2tab-${version}";
version = "0.3.0";
src = pkgs.fetchFromGitHub {
owner = "tock";
repo = "elf2tab";
rev = "v${version}";
sha256 = "1sf3ccqmr6d70shgf0zzxaiqfgk28yahvwdbhalkwaf2sg3yivpk";
};
cargoSha256 = "14w5haqbkd9pwdwc2rqknn4zzqkk93hf4ihdvh0q4lnih74wf7mj";
};
in
with pkgs;
stdenv.mkDerivation {
name = "tock-dev";
buildInputs = [
elf2tab
gcc-arm-embedded
python3Full
pythonPackages.tockloader
];
}