mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-01 05:04:40 +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
45 lines
896 B
Nix
45 lines
896 B
Nix
{
|
|
appimageTools,
|
|
makeWrapper,
|
|
|
|
pname,
|
|
version,
|
|
meta,
|
|
src,
|
|
}:
|
|
|
|
let
|
|
appimageContents = appimageTools.extract {
|
|
inherit pname version src;
|
|
};
|
|
in
|
|
appimageTools.wrapType2 {
|
|
inherit
|
|
pname
|
|
version
|
|
src
|
|
meta
|
|
;
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
];
|
|
|
|
extraPkgs = pkgs: [
|
|
pkgs.vulkan-headers
|
|
pkgs.vulkan-loader
|
|
];
|
|
|
|
extraInstallCommands = ''
|
|
install -D ${appimageContents}/upscayl.desktop -t $out/share/applications
|
|
install -D ${appimageContents}/upscayl.png -t $out/share/icons/hicolor/512x512/apps
|
|
|
|
substituteInPlace $out/share/applications/upscayl.desktop \
|
|
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=upscayl'
|
|
|
|
wrapProgram $out/bin/upscayl \
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
|
|
'';
|
|
|
|
}
|