A Rust CLI tool that recursively checks for git projects and reports their statuses, and optionally checks Nix flakes for flake.lock updates.

Zinc Oxide scans directories to find git repositories and displays their current status, showing which repositories have uncommitted changes. It's useful for managing multiple projects and ensuring all your repositories are in a clean state.

Installation

Nix flake

The flake's default package is built with the nix feature, so the flake lock checker (-F) is included.

Try it without installing:

nix run github:Mozart409/zinc_oxide -- -p ~/code

Install it into your profile:

nix profile install github:Mozart409/zinc_oxide

Or add it to a NixOS or home-manager configuration as a flake input:

{
  inputs.zinc_oxide.url = "github:Mozart409/zinc_oxide";

  outputs = { nixpkgs, zinc_oxide, ... }: {
    nixosConfigurations.my-host = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ({ pkgs, ... }: {
          environment.systemPackages = [
            zinc_oxide.packages.${pkgs.stdenv.hostPlatform.system}.default
          ];
          # home-manager: home.packages = [ zinc_oxide.packages.${pkgs.stdenv.hostPlatform.system}.default ];
        })
      ];
    };
  };
}

Cargo

git clone https://github.com/Mozart409/zinc_oxide
cargo install --path zinc_oxide

To enable the Nix flake checker, build with the nix feature:

cargo install --path zinc_oxide --features nix

Usage

Basic usage

zinc_oxide

Searches the current directory recursively for git repositories and reports their status.

Specify a path

zinc_oxide --path /path/to/search
zinc_oxide -p ~/code/

Show individual files

zinc_oxide -f

Shows the specific files that have uncommitted changes.

Show empty repositories

zinc_oxide -e

Includes repositories that have no uncommitted changes in the output.

Compact output

zinc_oxide -c

Prints only the number of repositories with uncommitted files, e.g. 3 repos. Combined with -F it also counts flakes with updates: 3 repos, 2 flakes with updates.

Combine options

zinc_oxide --path ~/code -f -e

Nix flake lock checker

zinc_oxide --path ~/code --flakes
zinc_oxide -F -f -p ~/code/rust/axon-gateway

Recursively discovers directories containing a flake.nix and checks each one for available flake.lock updates. Requires building with the nix Cargo feature and having the nix CLI on PATH. Without the feature, --flakes exits with an error.

Example output

Found 4 Nix flakes:

--- Flake: /home/you/code/rust/axon-gateway ---
Updates available!
  nixpkgs: 3b9f00d -> 8a2c4e1

--- Flake: /home/you/code/rust/zinc_oxide ---
Updates available!
  (only transitive inputs changed)

--- Flake: /home/you/code/scratch ---
No flake.lock file (needs initialization)

--- Flake: /home/you/code/website ---
No updates available

Options

Examples

# Search current directory for git repos with changes
zinc_oxide

# Search a specific directory and show changed files
zinc_oxide --path ~/dev -f

# Show all repositories including clean ones
zinc_oxide -e

# Check flakes and list which inputs would change
zinc_oxide -F -f -p ~/code

# Give slow flakes more time
zinc_oxide -F --flake-timeout 300 -p ~/code

Features