Hi,
我在macos下安装home-manager的时候发现swtich错误。是这两行的原因 dotty-nix/options.nix at 3323897abecdca6cf933173820068d2348a2b883 · ztlevi/dotty-nix · GitHub. 我如果把这两行去掉,是能够build的,但奇怪的是,我在nixos下是能正常switch的。
我试了home-manager master 和20.03的channel都不行,有没有大佬帮忙看下是什么问题。下面贴了错误信息。
我安装home-manager的流程在这边https://github.com/ztlevi/nix-dotfiles/blob/darwin/Makefile#L87-L92
building the system configuration...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
error: while evaluating the attribute 'config.system.build.toplevel' at undefined position:
while evaluating 'g' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:98:72, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:471:9:
while evaluating the option `system.build':
while evaluating the attribute 'mergedValue' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:503:5:
while evaluating 'merge' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:328:20, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:505:59:
while evaluating 'filterAttrs' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:124:23, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:329:35:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:125:29, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:125:18:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:329:51, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:125:62:
while evaluating the attribute 'toplevel' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:344:7:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:329:86, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:344:15:
while evaluating the attribute 'optionalValue' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:515:5:
while evaluating the attribute 'values' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:497:9:
while evaluating the attribute 'values' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:596:7:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:483:28, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:483:17:
while evaluating definitions from `/nix/store/j0r69hhvjml9c64868wmp0q2p3g9fyfr-darwin/darwin/modules/system':
while evaluating 'dischargeProperties' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:555:25, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:484:137:
while evaluating the attribute 'value' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:333:60:
while evaluating 'throwAssertions' at /nix/store/j0r69hhvjml9c64868wmp0q2p3g9fyfr-darwin/darwin/modules/system/default.nix:13:21, called from /nix/store/j0r69hhvjml9c64868wmp0q2p3g9fyfr-darwin/darwin/modules/system/default.nix:73:29:
while evaluating anonymous function at /nix/store/j0r69hhvjml9c64868wmp0q2p3g9fyfr-darwin/darwin/modules/system/default.nix:11:50, called from undefined position:
while evaluating the attribute 'assertion' at /Users/ztlevi/.nix-defexpr/channels/home-manager/nix-darwin/default.nix:82:32:
while evaluating the attribute 'assertion' at /Users/ztlevi/.nix-defexpr/channels/home-manager/modules/home-environment.nix:398:9:
while evaluating the attribute 'home.username' at undefined position:
while evaluating 'g' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:98:72, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:471:9:
while evaluating the option `home-manager.users.ztlevi.home.username':
while evaluating the attribute 'mergedValue' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:503:5:
while evaluating the attribute 'values' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:497:9:
while evaluating the attribute 'values' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:596:7:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:483:28, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:483:17:
while evaluating definitions from `/Users/ztlevi/.nix-defexpr/channels/home-manager/nix-darwin':
while evaluating 'dischargeProperties' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:555:25, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:484:137:
while evaluating the attribute 'value' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:338:44:
while evaluating the attribute 'users.users.ztlevi.name' at undefined position:
while evaluating 'g' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:98:72, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:471:9:
while evaluating the option `users.users':
while evaluating the attribute 'mergedValue' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:503:5:
while evaluating 'merge' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:328:20, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:505:59:
while evaluating 'filterAttrs' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:124:23, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:329:35:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:125:29, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:125:18:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:329:51, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:125:62:
while evaluating the attribute 'ztlevi' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:344:7:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:329:86, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/attrsets.nix:344:15:
while evaluating the attribute 'optionalValue' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:515:5:
while evaluating the attribute 'values' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:497:9:
while evaluating the attribute 'values' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:596:7:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:483:28, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:483:17:
while evaluating definitions from `/Users/ztlevi/.dotfiles/options.nix':
while evaluating 'dischargeProperties' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:555:25, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:484:137:
while evaluating the attribute 'condition' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:639:14:
while evaluating 'isType' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/types.nix:14:18, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:711:11:
while evaluating the attribute 'my.user' at undefined position:
while evaluating anonymous function at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:364:37, called from undefined position:
while evaluating the attribute 'matchedOptions' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:352:15:
while evaluating 'evalOptionValue' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:442:31, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:352:32:
while evaluating the attribute 'type.deprecationMessage' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:631:21:
while evaluating 'f' at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:620:11, called from /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:631:28:
value is a function while a set was expected, at /nix/store/7vy4n87yx9qriqryy2kznsjhcq8gmmj6-nixpkgs-21.03pre245942.89281dd1dfe/nixpkgs/lib/modules.nix:623:12
make: *** [mac_switch] Error 1