首页 > 解决方案 > 如何在 nix 包管理器中修改特定派生选项

问题描述

我想修改 Nix 派生(emacs macport)的定义。我希望将configureFlag值和“--with-mac-metal”更改为它。

我试过以下没有运气:

  emacsMacport.overrideDerivation
  (old: {
    configureFlags = [
      "LDFLAGS=-L${ncurses.out}/lib"
      "--with-xml2=yes"
      "--with-gnutls=yes"
      "--with-mac"
      "--with-modules"
      "--enable-mac-app=$$out/Applications"
      "--with-mac-metal"
    ];
  })

我正在使用 home-manager 和 nix-darwin,但出现以下异常:

error: A definition for option `home-manager.users.ashk.home.packages.[definition 16-entry 3]' is not of type `package'. Definition values:
       - In `/nix/store/mkcwa9i9brbxf81a01whhy53yzk87c9d-source/modules/hosts/zebra/home.nix': <function>
(use '--show-trace' to show detailed location information)        

标签: nixnixosdarwin

解决方案


当函数应用程序位于列表文字中时,您需要用括号括起来。有点奇怪。

从我多年来广泛使用 Nix 的经验来看,你可能永远不会习惯这一点。


推荐阅读