summary refs log tree commit diff
path: root/pkgs/development/embedded/platformio/chrootenv.nix
blob: 55adb0edaa750c73c24339b770d545bf2f9e509d (plain) (blame)
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
{ lib, buildFHSEnv, platformio-core }:

let
  pio-pkgs = pkgs:
    let
      inherit (platformio-core) python;
    in
    (with pkgs; [
      platformio-core
      zlib
      git
      xdg-user-dirs
      ncurses
    ]) ++ (with python.pkgs; [
      python
      setuptools
      pip
      bottle
    ]);

in
buildFHSEnv {
  name = "platformio";

  targetPkgs = pio-pkgs;
  # disabled temporarily because fastdiff no longer support 32bit
  # multiPkgs = pio-pkgs;

  meta = with lib; {
    description = "An open source ecosystem for IoT development";
    homepage = "https://platformio.org";
    maintainers = with maintainers; [ mog ];
    license = licenses.asl20;
    platforms = with platforms; linux;
  };

  extraInstallCommands = ''
    ln -s $out/bin/platformio $out/bin/pio
    ln -s ${platformio-core.udev}/lib $out/lib
  '';

  runScript = "platformio";
}