nix-direnv
2,819
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Shell
语言
—
创建时间
最近更新
项目能做什么
direnv 的扩展工具,提供快速且带缓存持久化的 use_nix 和 use_flake 实现。
来源:基于仓库元数据
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# nix-direnv

A faster, persistent implementation of `direnv`'s `use_nix` and `use_flake`, to
replace the built-in one.
Prominent features:
- significantly faster after the first run by caching the `nix-shell`
environment
- prevents garbage collection of build dependencies by symlinking the resulting
shell derivation in the user's `gcroots` (Life is too short to lose your
project's build cache if you are on a flight with no internet connection)
## Why not use `lorri` instead?
Compared to [lorri](https://github.com/nix-community/lorri), nix-direnv is
simpler (and requires no external daemon). Additionally, lorri can sometimes
re-evaluate the entirety of nixpkgs on every change (leading to perpetual high
CPU load).
## Installation
Requirements:
- bash 4.4
- nix 2.4 or newer
- direnv 2.21.3 or newer
> [!WARNING]\
> We assume that [direnv](https://direnv.net/) is installed properly because
> nix-direnv IS NOT a replacement for regular direnv _(only some of its
> functionality)_.
> [!NOTE]\
> nix-direnv requires a modern Bash. MacOS ships with bash 3.2 from 2007. As a
> work-around we suggest that macOS users install `direnv` via Nix or Homebrew.
> There are different ways to install nix-direnv, pick your favourite:
<details>
<summary> Via home-manager (Recommended)</summary>
### Via home-manager
Note that while the home-manager integration is recommended, some use cases
require the use of features only present in some versions of nix-direnv. It is
much harder to control the version of nix-direnv installed with this method. If
you require such specific control, please use another method of installing
nix-direnv.
In `$HOME/.config/home-manager/home.nix` add
```Nix
{
# ...other config, other config...
programs = {
direnv = {
enable = true;
enableBashIntegration = true; # see note on other shells below
nix-direnv.enable = true;
};
bash.enable = true; # see note on other shells below
};
}
```
Check the current
[Home Manager Options](https://home-manager-options.extranix.com/?query=direnv)
for integration with shells other than Bash. Be sure to also allow
`home-manager` to manage your shell with `programs.<your_shell>.enable = true`.
</details>
<details>
<summary>Direnv's source_url</summary>
### Direnv source_url
Put the following lines in your `.envrc`:
```bash
if ! has nix_direnv_version || ! nix_direnv_version 3.2.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.2.0/direnvrc" "sha256-hW6NC1JHue3IjZN3uDM6l6I2PMaauqd2D7hXYJ1Zfr4="
fi
```
</details>
<details>
<summary>Via system configuration on NixOS</summary>
### Via system configuration on NixOS
For NixOS 23.05+ all that's required is
```Nix
{
programs.direnv.enable = true;
}
```
other available options are:
```Nix
{ pkgs, ... }: {
#set to default values
programs.direnv = {
package = pkgs.direnv;
silent
阅读完整原文
项目深度分析 规则生成(AI 未配置)
综合评分 43.4 分。该项目在“个人可实施性”维度得 35 分,“付费可能性”维度得 20.0 分,差异化空间 70.0 分(评分依据见评分卡)。
面向细分需求的二次开发产品
| 产品构想 | 基于 nix-direnv 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。 |
| 目标用户 | 该细分场景用户 |
| 难度/周期 | 中 · 2~6 周 |
| 收费模式 | 买断制 / 订阅制 / 广告 |
| 竞争风险 | 细分需求规模需验证 |
| 依据 | AI 推测:基于项目主题标签的判断 |
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建时间待补全,最近推送 ,发布过 41 个 Release |
| 社区活跃 | Star 2,819 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。