mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 21:10:08 +00:00
Also migrates away from them with these commands, using ast-grep 0.43.0
with these commands in bash (assisted by ChatGPT):
```bash
for old in extractType1 extractType2; do
ast-grep \
--lang nix \
--pattern "\$TOOLS.$old" \
--rewrite '$TOOLS.extract' \
--update-all \
pkgs
done
ast-grep \
--lang nix \
--pattern '$TOOLS.wrapType1' \
--rewrite '$TOOLS.wrapType2' \
--update-all \
pkgs
```
Assisted-by: GPT-5.6-Sol Medium via ChatGPT
41 lines
979 B
Nix
41 lines
979 B
Nix
{
|
|
pname,
|
|
version,
|
|
src,
|
|
meta,
|
|
updateScript,
|
|
appimageTools,
|
|
makeWrapper,
|
|
}:
|
|
let
|
|
appimageContents = appimageTools.extract {
|
|
inherit pname version src;
|
|
};
|
|
|
|
in
|
|
|
|
appimageTools.wrapType2 {
|
|
inherit
|
|
pname
|
|
version
|
|
src
|
|
meta
|
|
;
|
|
|
|
passthru = { inherit updateScript; };
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
extraInstallCommands = ''
|
|
wrapProgram $out/bin/${pname} \
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
|
|
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
|
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/${pname}.png \
|
|
$out/share/icons/hicolor/512x512/apps/${pname}.png
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
'';
|
|
|
|
extraPkgs = pkgs: [ pkgs.nss_latest ];
|
|
}
|