# Install hpack with Homebrew, apt, Nix

Modern format for Haskell packages. Version 0.39.6 via Homebrew; verified 2026-06-13.

## Install

```sh
sudo av install brew:hpack
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install hpack
```

  Evidence: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install hpack
```

  Evidence: Debian stable package indexes: hpack from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#hpack
```

  Evidence: nixpkgs package indexes: hpack from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

## Package facts

- **Package key:** brew:hpack
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/hpack>
- **Version:** 0.39.6
- **Source summary:** Modern format for Haskell packages
- **Homepage:** <https://github.com/sol/hpack>
- **Repository:** <https://github.com/sol/hpack>
- **Upstream docs:** <https://github.com/sol/hpack#readme>
- **License:** MIT
- **Source archive:** <https://hackage.haskell.org/package/hpack-0.39.6/hpack-0.39.6.tar.gz>
- **Last updated:** 2026-06-13T23:34:58+02:00
- **Generated:** 2026-07-09T07:20:21+00:00

## Executables

- hpack (cli)
- hpack (alias)

## Dependencies

- gmp

## Build dependencies

- cabal-install
- ghc

## Uses from macOS

- libffi

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-09
- Package-manager version: 0.39.6
- Package-manager updated: 2026-06-13
- Local data: ok
- Upstream repository: https://github.com/sol/hpack
- info: No cached GitHub release or tag data was available.
## Project history and usage

hpack is a Haskell packaging tool and package-description format built around `package.yaml`. It generates Cabal files while trying to reduce repetition and make common package metadata less verbose.

### Project history

Simon Hengel's hpack appeared on Hackage in April 2015 with version 0.1.0. The project README describes it as a modern alternative to the Cabal package format, guided by three principles: infer obvious information, give users control when needed, and avoid repeating metadata.

hpack developed alongside Cabal rather than replacing it. The executable reads `package.yaml` and renders a `.cabal` file, while its changelog tracks years of Cabal compatibility work: SPDX license handling, generated module behavior, internal libraries, `build-tool-depends`, Cabal version inference, and support for newer GHC and Cabal releases.

### Adoption history

The README documents native `package.yaml` support in Stack and cabal2nix, while Hackage lists reverse dependencies including stack, pantry, cabal2nix, stack2cabal, stack-lib, and stackage2nix. That places hpack in the machinery around Haskell project templates, Stackage snapshots, and Nix conversion.

Homebrew, Hackage, Stackage, and Linux distribution packaging make hpack available both as a Haskell library/program and as a standalone CLI. Its adoption is tied to `package.yaml` becoming a common Haskell project file, especially in Stack-oriented projects.

### How it is used

Users write package metadata in `package.yaml`. Stack can consume that file directly, cabal2nix supports it natively, and other workflows can run `hpack` to generate the `.cabal` file before building.

hpack also supports practical package-authoring features such as defaults files, globbing, verbatim Cabal fields, generated module controls, common fields, conditionals, executables, tests, benchmarks, and dependency syntax intended to keep package descriptions maintainable.

### Why package nerds care

hpack is important because it sits at the contested boundary between package metadata as a human-maintained source file and package metadata as generated build-tool input. Package nerds care about that boundary: generated `.cabal` files can reduce repetition, but they also introduce questions about source-of-truth, reproducibility, diffs, and downstream tooling.

Its long changelog is also a miniature history of Haskell packaging pressure points, from SPDX licenses and Cabal version syntax to generated modules and compatibility with Stack, Stackage, Nix, and newer Cabal releases.

### Timeline

- 2015: Hackage records hpack 0.1.0 uploaded by Simon Hengel.
- 0.18.0: The changelog adds command-line input-file handling and executable shorthand.
- 0.29.0: The changelog adds Cabal 2.1/2.2-related rendering and SPDX license handling.
- 0.36.0: The changelog changes `Paths_` module inference for package specs using spec-version 0.36.0 or later.
- 2026: Hackage records hpack 0.39.6, adding top-level `codeberg` support.

### Related projects

- Cabal is the package format and build-tool ecosystem that hpack generates into.
- Stack has built-in support for hpack's `package.yaml` workflow.
- cabal2nix supports `package.yaml` natively, connecting hpack to Nix packaging workflows.
- Stackage-related tools such as pantry, stack2cabal, stack-lib, and stackage2nix appear in Hackage reverse-dependency metadata.

### Sources

- <https://docs.haskellstack.org/en/stable/topics/package_description/>
- <https://formulae.brew.sh/formula/hpack>
- <https://github.com/sol/hpack>
- <https://github.com/sol/hpack/blob/main/CHANGELOG.md>
- <https://hackage.haskell.org/package/hpack>
- <https://hackage.haskell.org/package/hpack-0.1.0>
- <https://hackage.haskell.org/package/hpack-0.39.6>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: package.yaml
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** hpack
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - hpack - 0.36.1-1+b1: normalized package name match | Debian stable package indexes: hpack from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | alternative format for Haskell packages | https://github.com/sol/hpack#readme
- Nix - hpack: normalized package name match | nixpkgs package indexes: hpack from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - hpack - 0.35.2-1: normalized package name match | Ubuntu 24.04 LTS package indexes: hpack from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | alternative format for Haskell packages | https://github.com/sol/hpack#readme


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Package publisher tools](https://www.automicvault.com/pkg/package-publishers/) - Belongs to a package publishing or registry command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [cabal-install](https://www.automicvault.com/pkg/brew/cabal-install/) - Build dependency declared by Homebrew.
- [ghc](https://www.automicvault.com/pkg/brew/ghc/) - Build dependency declared by Homebrew.
- [snapcraft](https://www.automicvault.com/pkg/brew/snapcraft/) - Shares av.db curated category or tags: build-tool, cli, developer-tools, packaging.
- [yeet](https://www.automicvault.com/pkg/brew/yeet/) - Shares av.db curated category or tags: build-tool, cli, developer-tools, packaging.
- [abi3audit](https://www.automicvault.com/pkg/brew/abi3audit/) - Shares av.db curated category or tags: cli, developer-tools, packaging.
- [cargo-bundle](https://www.automicvault.com/pkg/brew/cargo-bundle/) - Shares av.db curated category or tags: cli, developer-tools, packaging.
- [charmcraft](https://www.automicvault.com/pkg/brew/charmcraft/) - Shares av.db curated category or tags: cli, developer-tools, packaging.
- [create-dmg](https://www.automicvault.com/pkg/brew/create-dmg/) - Shares av.db curated category or tags: cli, developer-tools, packaging.
- [flit](https://www.automicvault.com/pkg/brew/flit/) - Shares av.db curated category or tags: cli, developer-tools, packaging.
- [maturin](https://www.automicvault.com/pkg/brew/maturin/) - Local metadata places this package in an adjacent workflow. Shared terms: build, build-tool, cli, developer, developer-tools.

## Combined YAML source

View the package source record on GitHub. [combined/hpack.yml](https://github.com/automic-vault/db/blob/main/combined/hpack.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
