[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81815":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":12,"openIssues":12,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":16,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":13,"starSnapshotCount":13,"syncStatus":14,"lastSyncTime":26,"discoverSource":27},81815,"eh","NotAShelf\u002Feh","NotAShelf","Ergonomic Nix helper",null,"Rust",38,1,0,2,4,6,47.3,"Mozilla Public License 2.0",false,"main",true,[],"2026-06-12 04:01:35","# eh - Ergonomic Nix CLI Helper\n\n[intelligent error handling]: #auto-retry-with-environment-variables\n[automatic fixes]: #hash-auto-fix\n\n`eh` is a multicall [^1] (think Busybox) CLI tool that provides _ergonomic_\nshortcuts for common Nix commands with [intelligent error handling], and more\nimportantly, [automatic fixes] for common Nix errors.\n\n[^1]: See [aliases](#shell-aliases) section.\n\n## Features\n\nWe provide a very tiny binary with a limited set of features. The most critical\nfeatures are **automatic hash fixes** and **auto-retry with appropriate\nenvironment variables**.\n\n### Auto-Retry with Environment Variables\n\nWhen a package fails to build due to licensing, security, stability, or whatever\nreason provided by Nixpkgs, `eh` equivalent of Nix commands retry automatically\nwith the appropriate environment variables. While this is called automatic\n_retry_, we collect information about the packages from the `meta` field instead\nof building the package. The following variables are supported:\n\n- **Unfree packages**: Sets `NIXPKGS_ALLOW_UNFREE=1`\n- **Insecure packages**: Sets `NIXPKGS_ALLOW_INSECURE=1`\n- **Broken packages**: Sets `NIXPKGS_ALLOW_BROKEN=1`\n\nAuto-retry requires that `--impure` is not explicitly disabled for the relevant\ncommand in the config file. By default retries are automatic. See\n[Configuration](#configuration).\n\n### Hash Auto-Fix\n\nWhen a hash mismatch is detected in the underlying `nix build`, `eh` can\nautomatically update the old, broken hash with a new and correct one _directly\nin the source file_.\n\n### Interactive `--ask` Flag\n\nPass `-a` \u002F `--ask` to any command (`run`, `shell`, `build`, `develop`) to\nenable interactive confirmation prompts. Before retrying with `--impure` or\nauto-fixing a hash mismatch, `eh` will ask for confirmation:\n\n```bash\neh build nixpkgs#steam --ask\n# ? Package 'steam' has an unfree license. Retry with --impure? (Y\u002Fn)\n# ? Hash mismatch detected in pkgs\u002Fhello\u002Fdefault.nix. Fix it? (Y\u002Fn)\n```\n\nIn non-interactive mode (no TTY), `--ask` raises an error rather than silently\nskipping. Without `--ask`, prompts only appear in TTY mode.\n\n## Shell Aliases\n\nBy default, you may run the `eh` binary akin to Nix with a nicer interface. The\nsupported Nix commands, i.e., nix `build`, `shell`, `run` and `develop` become\n`eh build`, `eh shell`, `eh run` and `eh develop`. However, it is possible to\nsymlink the `eh` binary to `,`, `nb`, `ns`, `nr`, `nd`, `dev`, `ni`, and `nu` to\ninvoke a specific feature. For example, `,` aliases to `eh comma`, `nb` will act\nas `eh build`, `nr` will be `eh run`, and `dev` is an alias for `nd`.\n\nOne special example is `eh update`, which is aliased to `nu`, that handles\ninteractive Nix flake updates. It is special in the sense that the usage is\nentirely different from its Nix counterpart, where you get to _interactively_\npick which inputs to update.\n\nAfter enabling shell aliases via the NixOS module or Home Manager, you can use:\n\n```bash\nns nixpkgs#hello           # equivalent to: nix shell nixpkgs#hello\nnr nixpkgs#cowsay \"Hello!\" # nix run nixpkgs#cowsay\nnb .#myPackage             # nix build .#myPackage\nnd .#myPackage             # nix develop .#myPackage\ndev .#myPackage            # nix develop .#myPackage (alias for nd)\nni nixpkgs#hello           # nix eval nixpkgs#hello.meta\nnu                         # nix flake update\n, glxgears                 # nix shell nixpkgs#mesa-demos -c glxgears\n```\n\n### Shell Completions\n\nGenerate completions for bash, zsh, or fish:\n\n```bash\neh completion bash\neh completion zsh\neh completion fish\n```\n\n### Shell Integration Scripts\n\nSourceable shell integration scripts are available in the Nix package output\nunder `$out\u002Fnix\u002Fintegrations\u002F`:\n\n| File        | Description                         |\n| ----------- | ----------------------------------- |\n| `bash.sh`   | Aliases and completion setup (bash) |\n| `zsh.sh`    | Aliases and completion setup (zsh)  |\n| `fish.fish` | Aliases and completion setup (fish) |\n| `direnvrc`  | Direnv integration for flakes       |\n\n## Configuration\n\n`eh` reads configuration from the first `.eh.toml` found by walking up from the\ncurrent directory, falling back to `~\u002F.config\u002Feh\u002Fconfig.toml`. If no file\nexists, all defaults apply and no extra flags are passed to Nix.\n\n### Global settings\n\nTop-level keys apply to every command unless overridden per-command:\n\n```toml\n# Explicitly enable --impure for all commands (also passes it on initial run).\nimpure = true\n\n# Explicitly disable impure retries for all commands.\nimpure = false\n```\n\n> [!TIP]\n> When `impure` is absent (the default), auto-retry with `--impure` is\n> **automatic**. `eh` will add `--impure` and the appropriate `NIXPKGS_ALLOW_*`\n> variable whenever it detects an unfree, insecure, or broken package.\n\n\u003C!--markdownlint-disable MD013-->\n\n| Key      | Type | Default | Description                                                    |\n| -------- | ---- | ------- | -------------------------------------------------------------- |\n| `impure` | bool | -       | `true` passes `--impure` always; `false` blocks impure retries |\n\n\u003C!--markdownlint-enable MD013-->\n\n### Per-command settings\n\nEach command can be configured independently under `[commands.\u003Cname>]`. A\nper-command setting takes precedence over the global one; the global setting\napplies to commands that do not have their own entry.\n\n```toml\n[commands.build]\nimpure = true\nenv = { NIXPKGS_ALLOW_UNFREE = \"1\" }\n\n[commands.develop]\nimpure = false\n\n[commands.develop.env]\nMY_DEV_VAR = \"1\"\n```\n\n\u003C!--markdownlint-disable MD013-->\n\n| Key      | Type  | Default | Description                                                                     |\n| -------- | ----- | ------- | ------------------------------------------------------------------------------- |\n| `impure` | bool  | -       | `true` passes `--impure` always; `false` blocks impure retries for this command |\n| `env`    | table | `{}`    | Extra environment variables to set for the command                              |\n\n\u003C!--markdownlint-enable MD013-->\n\n### Impure mode and unfree\u002Finsecure\u002Fbroken packages\n\nWhen `eh` detects that a package requires `--impure` (unfree, insecure, or\nbroken), it retries automatically with the appropriate `NIXPKGS_ALLOW_*`\nvariable and `--impure` by default.\n\nIf `impure = false` is set for the active command (or globally), the retry is\nblocked and an error is shown instead:\n\n```plaintext\n! package has an unfree license but `--impure` is disabled for `build` in config\n~ set `impure = true` for this command (or globally) in .eh.toml or\n  ~\u002F.config\u002Feh\u002Fconfig.toml, or pass `--impure` manually\n```\n\nTo explicitly enable `--impure` for a specific command (also adds it to the\ninitial run, not just retries):\n\n```toml\n[commands.build]\nimpure = true\n```\n\nTo disable impure retries globally:\n\n```toml\nimpure = false\n```\n\n## License\n\n\u003C!--markdownlint-disable MD059-->\n\nThis project is made available under Mozilla Public License (MPL) version 2.0.\nSee [LICENSE](LICENSE) for more details on the exact conditions. An online copy\nis provided [here](https:\u002F\u002Fwww.mozilla.org\u002Fen-US\u002FMPL\u002F2.0\u002F).\n\n\u003C!--markdownlint-enable MD059-->\n","eh 是一个旨在提高 Nix 包管理器用户体验的命令行工具，主要通过智能错误处理和自动修复常见问题来简化 Nix 操作。其核心功能包括自动哈希修正与基于环境变量的自动重试机制，支持解决因许可、安全或稳定性原因导致的构建失败。特别地，当遇到未授权、不安全或损坏的包时，eh 可以设置相应的环境变量（如NIXPKGS_ALLOW_UNFREE）并自动重试。此外，还提供了交互式确认提示选项，允许用户在执行潜在更改前进行确认。此工具适用于需要频繁使用 Nix 进行开发、构建及维护软件包的场景，尤其对于那些希望减少手动干预和提高工作效率的开发者来说非常有用。","2026-06-11 04:06:50","CREATED_QUERY"]