Files
nixpkgs/pkgs/by-name/ca/capacities/package.nix
bitbloxhub c831bab4ac appimageTools: warn on deprecated type-specific aliases
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
2026-07-30 00:21:21 +00:00

69 lines
1.9 KiB
Nix

{
fetchurl,
appimageTools,
makeWrapper,
imagemagick,
lib,
}:
let
pname = "capacities";
version = "1.65.13";
src = fetchurl {
url = "https://web.archive.org/web/20260518194627/https://2vks4.upcloudobjects.com/capacities-desktop-app/Capacities-1.65.13.AppImage";
hash = "sha256-ATiX1h9hXmKMFtY6OEyZEoJ/SxJGgbj5/QZwFF1sfFQ=";
};
appimageContents = appimageTools.extract {
inherit
pname
src
version
;
};
in
appimageTools.wrapType2 {
inherit
pname
src
version
;
extraInstallCommands = ''
source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/capacities \
--add-flags "--ozone-platform-hint=auto"
# Check for required desktop file
if [ ! -f ${appimageContents}/capacities.desktop ]; then
echo "Error: Missing .desktop file in ${appimageContents}"
exit 1
else
# Install and modify the desktop file
install -m 444 -D ${appimageContents}/capacities.desktop $out/share/applications/capacities.desktop
substituteInPlace $out/share/applications/capacities.desktop \
--replace-fail "Exec=AppRun" "Exec=capacities"
fi
# Check for required icon file
if [ ! -f ${appimageContents}/capacities.png ]; then
echo "Error: Missing icon file in ${appimageContents}"
exit 1
else
# Resize and install the icon
${lib.getExe imagemagick} ${appimageContents}/capacities.png -resize 512x512 capacities_512.png
install -m 444 -D capacities_512.png $out/share/icons/hicolor/512x512/apps/capacities.png
fi
'';
meta = {
description = "Calm place to make sense of the world and create amazing things";
homepage = "https://capacities.io/";
platforms = [ "x86_64-linux" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
license = lib.licenses.unfree;
mainProgram = "capacities";
maintainers = [ lib.maintainers.keysmashes ];
};
}