我正在尝试使用 nix,但我遇到了一个我认为与 nix 未能构建 nano 有关的问题,但我不确定。我在 OSX 10.11.4 上(我对 Mac 也很陌生)并且收到以下错误:
clang -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/nix/store/h1afxzyfxh7xc8b0scvq831s1yapczgm-nano-2.6.3/share/locale\" -DSYSCONFDIR=\"/etc\" -I/nix/store/gmb9mxkm5mqfnhlav16rx5x7wf070qqf-ncurses-5.9-dev/include/ncursesw -I/nix/store/gmb9mxkm5mqfnhlav16rx5x7wf070qqf-ncurses-5.9-dev/include -g -O2 -Wall -c -o winio.o winio.c
winio.c:513:15: error: use of undeclared identifier 'TIOCLINUX'
if (ioctl(0, TIOCLINUX, &modifiers) >= 0 && (modifiers & 0x04)) {
^
1 error generated.
有什么我在这里设置不正确的吗?我所做的只是通过curl ... | sh
and then设置 nix source ~/.nix-profile/etc/profile.d/nix.sh
。
我正在尝试从这个 shell.nix 构建:
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
let
inherit (nixpkgs) pkgs;
# Build a default.nix file from our .cabal file:
here = ./.;
project = pkgs.stdenv.mkDerivation ({
name = "default.nix";
buildCommand = ''
${pkgs.cabal2nix}/bin/cabal2nix file://${here} > $out
'';
});
# Use the package set for our compiler:
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
# Helper function that gets Nix-packaged dependencies off GitHub.
# GitHub project needs a default.nix file for this to work.
fetchHaskell = { url, rev, sha256 }:
haskellPackages.callPackage (pkgs.fetchgit { inherit url rev sha256; }) {};
drv = haskellPackages.callPackage project {
# Specify GitHub dependencies here.
# You can get url, rev and sha256 by running 'nix-prefetch-git git@...'
...snip....
};
in
if pkgs.lib.inNixShell then drv.env else drv
任何指针将不胜感激。