NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.82k stars 13.92k forks source link

Make appimage overridable #345717

Open MrQubo opened 2 weeks ago

MrQubo commented 2 weeks ago

It should be possible to override appimage packages generated with appimageTools.wrapType2. I'm thinking something analogous to overridePythonAttrs.

E.g. something like this should work:

arduino-ide.overrideAppimageAttrs { extraPkgs = pkgs: (arduino-ide.extraPkgs pkgs) ++ [ pkgs.python3 ]; }

Add a :+1: reaction to issues you find important.

TomaSajt commented 2 weeks ago

Here's a pretty ugly workaround you could do:

arduino-ide.override {
  appimageTools = appimageTools // {
    wrapType2 =
      args:
      appimageTools.wrapType2 (args // { extraPkgs = pkgs: args.extraPkgs pkgs ++ [ pkgs.python3 ]; });
  };
}

This method overrides the builder itself to inject the extra logic into it. This should work with other types of builders too.

gregoryholder commented 1 week ago

Thank you, this was exactly what I was looking for !

For the full story (and for future reference), I had added the "esp32" board manager in the Arduino IDE, but it didn't work as it required python with pyserial. With your workaround I now have:

let
arduino-ide_with_pyserial = with pkgs; arduino-ide.override {
    appimageTools = appimageTools // {
      wrapType2 =
        args:
        appimageTools.wrapType2 (args // { extraPkgs = pkgs: args.extraPkgs pkgs ++ [ 
          (pkgs.python3.withPackages (m: [m.pyserial])) 
        ]; 
      });
    };
  };

P.S Thanks to @MrQubo who recommended I make an issue, but then beat me to it