Skip to content

Instantly share code, notes, and snippets.

@mausch
Created May 10, 2026 16:02
Show Gist options
  • Select an option

  • Save mausch/ce4a24b8a7293d0c28a4d72afcd1697f to your computer and use it in GitHub Desktop.

Select an option

Save mausch/ce4a24b8a7293d0c28a4d72afcd1697f to your computer and use it in GitHub Desktop.
vastai-cli
{
description = "Standalone flake packaging vast-cli";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/549bd84d6279f9852cae6225e372cc67fb91a4c1";
};
outputs = inputs@{ flake-parts, nixpkgs, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = { pkgs, ... }:
let
python = pkgs.python3;
pythonPkgs = python.pkgs;
borb = pythonPkgs.borb.overridePythonAttrs (_: {
doCheck = false;
});
vast-cli = pythonPkgs.buildPythonApplication rec {
pname = "vast-cli";
version = "1.0.12";
pyproject = true;
src = pkgs.fetchFromGitHub {
owner = "vast-ai";
repo = "vast-cli";
tag = "v${version}";
hash = "sha256-UondZHTgZR2X4cSQb/61lYHeGtcWUMQTrNzU86IxdPM=";
};
pythonRelaxDeps = true;
nativeBuildInputs = [
pythonPkgs.pythonRelaxDepsHook
];
build-system = [
pythonPkgs.poetry-core
];
dependencies = with pythonPkgs; [
xdg
borb
requests
python-dateutil
urllib3
pyparsing
aiohttp
aiodns
pycares
anyio
psutil
pycryptodome
argcomplete
curlify
rich
cryptography
pillow
typing-extensions
poetry-dynamic-versioning
];
pythonImportsCheck = [
"vastai"
"vastai_sdk"
];
meta = with pkgs.lib; {
description = "CLI and SDK for Vast.ai GPU Cloud Service";
homepage = "https://vast.ai";
changelog = "https://github.com/vast-ai/vast-cli/releases/tag/v${version}";
license = licenses.mit;
mainProgram = "vastai";
platforms = platforms.all;
};
};
in
{
packages = {
default = vast-cli;
inherit vast-cli;
};
apps.default = {
type = "app";
program = "${vast-cli}/bin/vastai";
};
};
};
}
@mausch
Copy link
Copy Markdown
Author

mausch commented May 10, 2026

https://github.com/vast-ai/vast-cli

nix run --refresh --no-write-lock-file git+https://gist.github.com/mausch/ce4a24b8a7293d0c28a4d72afcd1697f.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment