我希望这个here
let config_ = lib.debug.showVal (config); in
....
systemd = import ./systemd { inherit pkgs; config = config_; };
显示配置内容,为什么我不看?
$ sudo nixos-rebuild dry-build --show-trace
building the system configuration...
these derivations will be built:
/nix/store/g24yj8lzz2zg921daibfbj2yz5933fwn-hubstaff-1.3.0-9b2ba62.drv
/nix/store/hps81xprfk0b4lhq8z2vycn1jq4ds841-system-path.drv
/nix/store/1s689dqbl45g094mnd5sjzdh44wrd6g5-dbus-1.drv
/nix/store/wqhr5z2f7l0a49fxb4arkwagb1iwmkx4-unit-dbus.service.drv
.....
/nix/store/8r03578gxmk2plvxn4p0jbj8aal63vc6-lightdm.conf.drv
/nix/store/i2ikmkxhgyns0ylj17cw2yv0v82m0lfh-etc.drv
/nix/store/kwqbq4mmim8ph4i3zjbsi5hhwjr6qkg7-nixos-system-machine-18.03.131954.2569e482904.drv
答案 0 :(得分:1)
That version of the systemd/default.nix
函数不会评估其参数的config
属性,因此它也不会评估您的调试函数。 Nix语言评估by need。
要打印config
,请确保对其进行评估。一个可以帮助你的函数是builtins.seq
它评估它的第一个参数,但返回第二个参数。在文件顶部试试这个:
{ config, pkgs, ... }:
with pkgs;
builtins.seq (lib.debug.showVal config) {
imports = [
/* etcetera */