summary refs log tree commit diff
path: root/pkgs/development/embedded/platformio/chrootenv.nix
blob: 3f4a7e7385dc5730b146bf69417f2d9964eb9e0a (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
{ lib, buildFHSUserEnv, platformio-core }:

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

in
buildFHSUserEnv {
  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";
}