mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-13 02:39:58 +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
31 lines
832 B
Nix
31 lines
832 B
Nix
{ appimageTools, fetchurl }:
|
|
|
|
let
|
|
pname = "krunker";
|
|
version = "2.1.3";
|
|
|
|
appId = "io.krunker.desktop";
|
|
|
|
src = fetchurl {
|
|
url = "https://client2.krunker.io/Official%20Krunker.io%20Client-${version}.AppImage";
|
|
hash = "sha512-a8E5heLsKXOtv/wRKlrnV0GD48cY1mOiSSDW93c7YZ+HoeuBQDxtRaHKg5EqU51Yi+d4tPF5nOh10jZW36c7WQ==";
|
|
};
|
|
|
|
appimageContents = appimageTools.extract {
|
|
inherit pname version src;
|
|
};
|
|
in
|
|
|
|
appimageTools.wrapType2 {
|
|
inherit pname version src;
|
|
|
|
extraInstallCommands = ''
|
|
mkdir -p $out/share/{applications,pixmaps}
|
|
install -Dm644 ${appimageContents}/${appId}.desktop -t $out/share/applications
|
|
install -Dm644 ${appimageContents}/${appId}.png -t $out/share/pixmaps
|
|
|
|
substituteInPlace $out/share/applications/${appId}.desktop \
|
|
--replace-fail 'Exec=AppRun' "Exec=$pname"
|
|
'';
|
|
}
|