-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
58 lines (54 loc) · 1.52 KB
/
flake.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
{
description = "Development environment for the BLIND project";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
devShells.${system}.default =
let
pigpio = pkgs.stdenv.mkDerivation {
name = "pigpio";
src = pkgs.fetchFromGitHub {
owner = "joan2937";
repo = "pigpio";
rev = "c33738a320a3e28824af7807edafda440952c05d";
sha256 = "Z+SwUlBbtWtnbjTe0IghR3gIKS43ZziN0amYtmXy7HE=";
};
buildInputs = [ pkgs.cmake pkgs.gnumake ];
phases = [ "buildPhase" "installPhase"];
buildPhase = ''
cmake -S $src -B .
make -j
'';
installPhase = ''
mkdir -p $out/include $out/lib $out/bin
cp $src/pigpio.h $out/include
cp *.so $out/lib
cp pigpiod $out/bin
'';
};
in
pkgs.mkShell {
buildInputs = with pkgs; [
gcc
gnumake
clang-tools
gdb
bear
cmake
cmake-language-server
opencv
arduino
arduino-cli
python310
boost
fmt
] ++ [ pigpio ];
};
};
}