- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据我的阅读内容(特别是 the wiki 和 this blog post ),我提出了使用 nix-shell
加载的以下 default.nix
:
with import <nixpkgs> {};
let emacs =
emacsWithPackages (p : [ p.tuareg ]);
in
stdenv.mkDerivation rec {
name = "env";
src = ./.;
# Customizable development requirements
buildInputs = [
pkgconfig
ocaml
ocamlPackages.merlin
ocamlPackages.findlib
ocamlPackages.lablgtk
ocamlPackages.camlp5_transitional
ncurses
emacs
];
# Customizable development shell setup
shellHook = ''
export PATH=`pwd`/bin:$PATH
'';
}
但它总是打印警告:
warning: dumping very large path (> 256 MiB); this may run out of memory
加载时间很长(启动后第一次调用 nix-shell
大约需要 45 秒,后续调用大约需要 2 秒)。
此消息的含义是什么?当我在Google上查找时,我发现了一些GitHub问题,但没有以外行人易于理解的方式表达。
我可以加快加载速度并删除此消息吗?在我看来,我做错了什么。
是否存在我可能不知道的关于编写此类开发环境的一般建议?
最佳答案
可能src
属性(当前目录)非常大。 nix-shell 会在每次调用时将其复制到 Nix 存储,这可能不是您想要/需要的。解决方法是编写:
src = if lib.inNixShell then null else ./.;
(其中 lib
来自 Nixpkgs)。
这样,./.
将在您调用 nix-build
时被复制,但在您运行 nix-shell
时不会被复制。
关于ocaml - 如何正确使用 nix-shell 并避免 "dumping very large path"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39372157/
学习如何使用 Nix 包管理器时遇到的第一种 Nix 表达式是 default.nix;在精彩的 NixOS IRC channel 上,我还了解到 shell.nix 和 release.nix 的
一段时间后,我的开发机器中的磁盘空间开始用完(只有 128GB)。出于这个原因,我决定将本地缓存存储(.npm、.m2、.ivy2 等)移动到外部驱动器。 在经历了众所周知的“ cabal hell
我按照 http://lethalman.blogspot.com/2014/08/nix-pill-8-generic-builders.html 上的步骤操作构建 GNU Hello,这是我用来构
我过去注意到在 nix , 一个 ./myfile.txt路径类型似乎 有时评估为 /home/myuser/mydir/myfile.txt , 和 有时到 /nix/store/55j24v9qw
即使在阅读了 Nix 手册之后,仍然对 Nix 表达式的真正含义感到困惑。有时它们被称为派生,但存储派生也有其他含义。 最佳答案 在 Nix 中,Nix 表达式只是您可以用 Nix 语言编写的任何类型
我没有在 Nix 派生中找到任何关于处理临时文件的信息。 我找到了 $TMP 和 $TMPDIR 环境变量,但它们都指向 /tmp,这是系统全局的。 { pkgs ? import {} }:
我有一个 default.nix构建派生的文件(至少我对它的理解)。 { nixpkgs ? import {}, compiler ? "ghc864" } : nixpkgs.pkgs.hask
所以,终于开始获得一个稳定的 nix 环境,我基本上可以在其中进行所有的开发。万岁! 现在我想让它重现,如 yarn.lock (对于那些熟悉 javascript 领域中的 npm/yarn 的人)
运行时的某个时候nix-build和 nixos-rebuild我发现了易于修复的问题(例如不推荐使用的警告或多余的导入),我想“有趣,我可以在空闲时间解决这个问题”。 我知道我可以将构建日志重定向到
我刚刚开始了解 Nix,所以如果我错过了文档中问题的答案,我深表歉意。 我想使用 Nix 设置一台具有最少库和可执行文件集的安全生产机器。我不希望存在任何编译器或其他构建工具,因为这些可能存在安全风险
我只使用 Nix作为包管理器而不使用全部NixOS .我想要一个可重现的 nix-env -i可以共享和备份的软件包安装。 我知道使用 config.nix为 NixOS但我正在寻找与 Nix 类似的
我写了一个非常简单的 default.nix 文件,我应该可以用它来构建 gnu hello 包(类似于 nix-pills)。 但是现在我遇到了一个错误: [jane@nixos:~/graphvi
我正在编写一个 .nix 表达式,主要供 nix-shell 使用。 .我不知道该怎么做。请注意,这不在 NixOS 上,但我认为这不是很相关。 我正在查看的特定示例是我想获得 this versio
我知道 a similar question , 但它指的是 ? 在 function definitions with a set pattern 中使用(pinned)。 我查看了 lib.mak
我相信我跑了nix-env -if example.nix这改变了我的 nix 环境。 如何撤消此操作? 我正在尝试运行在我的 nixos 配置( /etc/nixos/* )中指定的应用程序,但它似
我想运行一个安装了以下软件包的 nix-shell: aspell aspellDicts.en 你好 我不能简单地做:nix-shell -p aspell aspellDicts.en hello
我是 nix 世界的新手,我使用 Mac OS X。我刚刚在我的 MacBook 上安装了 nix,并想使用 nix 来管理一些软件包,例如 Emacs 而不是 Homebrew。 我找到了这个仓库:
在 Nix 手册的 Inheriting attributes 中部分,我们有 graphviz = (import ../tools/graphics/graphviz) { inherit f
我想在相同架构的多台 openSUSE 机器(不同版本)上使用 nix-package manager 一致地安装软件。我不是任何系统的 root,但想说服我们的系统管理员在所有使用网络挂载的机器上以
我创建了自己的存储库来获取一些 git 源。 # packages.nix with (import {}); rec { rustcSource = fetchgit { url =
我是一名优秀的程序员,十分优秀!