# Ngicks Dotfiles Nix Update Hash

> Nix Update Hash

- Skill: `tomevault-io/ngicks-dotfiles-nix-update-hash` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/ngicks-dotfiles-nix-update-hash`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/ngicks-dotfiles-nix-update-hash/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/ngicks-dotfiles-nix-update-hash

---


# Nix Update Hash

Compute correct hashes for Nix package definitions.

## Commands

### Vendor Hash (for `buildGoModule` packages)

Computes the correct `vendorHash` by building with `lib.fakeHash` and extracting the real hash.

**Single package:**
```bash
"$SKILL_DIR/nix-update-hash.sh" vendor <pkgs-dir> <pkg-name>
```

**All packages in directory:**
```bash
"$SKILL_DIR/nix-update-hash.sh" vendor <pkgs-dir>
```

**Examples:**
```bash
# Single package — resolves to nix-craft/pkgs/lsp-gw.nix
"$SKILL_DIR/nix-update-hash.sh" vendor nix-craft/pkgs lsp-gw

# All .nix files in the directory
"$SKILL_DIR/nix-update-hash.sh" vendor nix-craft/pkgs
```

After getting the hash, update the `vendorHash` field in the `.nix` file.

### GitHub Source Hash

Prefetches a GitHub repo at a specific revision and returns the hash:

```bash
"$SKILL_DIR/nix-update-hash.sh" github <owner> <repo> <rev>
```

**Example:**
```bash
"$SKILL_DIR/nix-update-hash.sh" github neovim go-client v1.2.3
```

## Workflow

1. Identify the Nix package file that needs a hash update
2. Run the appropriate subcommand to compute the correct hash
3. Update the hash field in the `.nix` file with the result

## Output

Both commands print the hash string to stdout (e.g., `sha256-...`). Errors go to stderr with a non-zero exit code.

## Notes

- The `vendor` subcommand requires `nix-build` and access to `<nixpkgs>`
- The `github` subcommand requires `nix flake prefetch` (experimental features: nix-command, flakes) and `jq`
- Vendor hash computation involves a full build attempt, so it may take some time

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/ngicks) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

