Files
nixpkgs/pkgs/by-name/sp/sprite/package.nix
2026-08-18 12:22:42 +00:00

56 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchurl,
versionCheckHook,
autoPatchelfHook,
writableTmpDirAsHomeHook,
makeWrapper,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sprite";
version = "0.0.1-rc48";
src = fetchurl {
url = "https://sprites-binaries.t3.storage.dev/client/v${finalAttrs.version}/sprite-${
if stdenv.hostPlatform.isLinux then "linux" else "darwin"
}-${if stdenv.hostPlatform.isx86_64 then "amd64" else "arm64"}.tar.gz";
hash =
{
aarch64-darwin = "sha256-HoYKvupDS4Lak5ce07yZ8VkgafzxlSI0YNb6pg+xRTg=";
aarch64-linux = "sha256-taj5QskS1bRgv0QFh9nu/IXUvzJCXGxiDP6lYPaL5tU=";
x86_64-linux = "sha256-UlgRQoNfiFTSIgaj67qcNriXEcorM0XPJC1Doy3HnP4=";
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
};
sourceRoot = ".";
nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
installPhase = ''
mkdir -p $out/bin
install -m 755 sprite $out/bin/
wrapProgram $out/bin/sprite --set UPGRADE_CHECK false
'';
passthru.updateScript = ./update.sh;
nativeInstallCheckInputs = [
versionCheckHook
writableTmpDirAsHomeHook
];
versionCheckProgramArg = "--version";
versionCheckKeepEnvironment = "HOME";
doInstallCheck = true;
meta = {
description = "Command Line Interactive for sprites, stateful sandbox environments with checkpoint & restore";
homepage = "https://sprites.dev";
license = lib.licenses.unfree;
mainProgram = "sprite";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [ drawbu ];
};
})