diff options
Diffstat (limited to 'pkgs/development/embedded/arduino/arduino-core/chrootenv.nix')
-rw-r--r-- | pkgs/development/embedded/arduino/arduino-core/chrootenv.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/development/embedded/arduino/arduino-core/chrootenv.nix b/pkgs/development/embedded/arduino/arduino-core/chrootenv.nix new file mode 100644 index 0000000000000..4c13b2493a9a4 --- /dev/null +++ b/pkgs/development/embedded/arduino/arduino-core/chrootenv.nix @@ -0,0 +1,36 @@ +{ lib, buildFHSUserEnv, arduino-core-unwrapped, withGui ? false, withTeensyduino ? false }: +let + arduino-unwrapped = arduino-core-unwrapped.override { inherit withGui withTeensyduino; }; +in +buildFHSUserEnv { + name = "arduino"; + + targetPkgs = + pkgs: (with pkgs; [ + ncurses + arduino-unwrapped + zlib + (python3.withPackages (p: with p; [ + pyserial + ])) + ]); + multiPkgs = null; + + extraInstallCommands = '' + ${lib.optionalString withGui '' + # desktop file + mkdir -p $out/share/applications + cp ${arduino-core-unwrapped.src}/build/linux/dist/desktop.template $out/share/applications/arduino.desktop + substituteInPlace $out/share/applications/arduino.desktop \ + --replace '<BINARY_LOCATION>' "$out/bin/arduino" \ + --replace '<ICON_NAME>' "$out/share/arduino/icons/128x128/apps/arduino.png" + # icon file + mkdir -p $out/share/arduino + cp -r ${arduino-core-unwrapped.src}/build/shared/icons $out/share/arduino + ''} + ''; + + runScript = "arduino"; + + meta = arduino-core-unwrapped.meta; +} |