Skip to content

orual/flake

Repository files navigation

flake

Package Update Script

The update-packages.sh script automates updating custom packages in the pkgs/ directory.

Features

  • Automatically detects package type (Go, NPM, Python)
  • Creates backup git commits before updates
  • Updates package versions and hashes automatically
  • Supports updating all packages or specific ones
  • Easy rollback with git

Usage

As a Flake App (Recommended)

# List all available packages
nix run .#update-packages -- --list

# Update all packages
nix run .#update-packages

# Update a specific package
nix run .#update-packages -- opencode

# Update without creating backup commit
nix run .#update-packages -- --no-commit claude-code

# Show help
nix run .#update-packages -- --help

Direct Script Execution

# Enter dev shell for required tools
nix develop

# List all available packages
./update-packages.sh --list

# Update all packages
./update-packages.sh

# Update a specific package
./update-packages.sh opencode

# Update without creating backup commit
./update-packages.sh --no-commit claude-code

# Show help
./update-packages.sh --help

How it works

  1. Go packages: Fetches latest GitHub release/tag, updates version and hash
  2. NPM packages: Gets latest version from npm registry, updates package-lock.json if present
  3. Python packages: Uses nix-update for unstable packages, or GitHub releases for others

Reverting changes

# Revert all uncommitted changes
git reset --hard HEAD

# Revert to backup commit
git reset --hard HEAD~1

Adding support for new package types

Edit update-packages.sh and add a new update function following the existing patterns.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published