Zinc Oxide
Documentation
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_oxidecargo 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/searchzinc_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 --flakeszinc_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.
-
Non-mutating: each check runs
nix flake updateagainst a throwaway lock path, so your existingflake.lockfiles are never modified. - Parallel: up to 8 flakes are checked at once.
-
Timeouts: each check is abandoned after
--flake-timeoutseconds (default 120). -
Changed inputs: with
-f, lists the flake's direct inputs whose locked revision would change, or notes that only transitive inputs changed. -
Missing locks: flakes without a
flake.lockare reported as needing initialization instead of having one created. -
Failures: failed checks show the error output from
nix.
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
Examples
# Search current directory for git repos with changeszinc_oxide# Search a specific directory and show changed fileszinc_oxide --path ~/dev -f# Show all repositories including clean oneszinc_oxide -e# Check flakes and list which inputs would changezinc_oxide -F -f -p ~/code# Give slow flakes more timezinc_oxide -F --flake-timeout 300 -p ~/code
Features
- Recursive directory scanning for git repositories
- Status reporting for uncommitted changes
- File-level detail when requested
- Hidden directories and symlinks are not followed
- Bare and invalid repositories are skipped
-
Optional Nix flake lock-update checker: non-mutating, parallel, with
per-flake timeouts and changed-input listing (behind the
nixCargo feature) - Non-zero exit status on errors
- End-to-end test suite against golden output