| 23 Oct 2022 |
@blaggacao:matrix.org | Or maybe you mean something else than what I understood? | 15:55:43 |
@blaggacao:matrix.org | In the unlikely event that somebody is keen on helping with an infinite recursion, here are the neuralgic points of the trace:
at /nix/store/gv1gp6l2gqgf7j6fpswbcdsr6yi395xy-source/make-honey.nix:123:34:
122| (l.mapAttrs (machine: checkAndTransformConfig user machine))
123| (l.filterAttrs (_: config: config.nixpkgs.system == system))
| ^
124| (l.mapAttrs (machine: l.nameValuePair "${user}-o-${machine}"))
[...]
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:751:121:
750| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
751| in throw "A definition for option `${showOption loc}' is not of type `${type.description}'. Definition values:${showDefs allInvalid}"
| ^
752| else
… while evaluating the attribute 'mergedValue'
[ ... ]
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/options.nix:342:10:
341| prettyEval = builtins.tryEval
342| (lib.generators.toPretty { }
| ^
343| (lib.generators.withRecursion { depthLimit = 10; throwOnDepthLimit = false; } def.value));
… while evaluating anonymous lambda
[ ... ]
error: attribute 'pkgs' missing
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:467:28:
466| builtins.addErrorContext (context name)
467| (args.${name} or config._module.args.${name})
| ^
468| ) (lib.functionArgs f);
… while evaluating the module argument `pkgs' in "/nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/nixos/modules/profiles/installation-device.nix":
… while evaluating anonymous lambda
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:465:44:
464| context = name: ''while evaluating the module argument `${name}' in "${key}":'';
465| extraArgs = builtins.mapAttrs (name: _:
| ^
466| builtins.addErrorContext (context name)
… from call site
… while evaluating 'id'
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/trivial.nix:14:5:
13| # The value to return
14| x: x;
| ^
15|
… from call site
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/generators.nix:272:47:
271| let
272| evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
| ^
273| in
… while evaluating anonymous lambda
| 16:11:28 |
@blaggacao:matrix.org | * In the unlikely event that somebody is keen on helping with an infinite recursion, here are the neuralgic points of the trace (in reverse order):
at /nix/store/gv1gp6l2gqgf7j6fpswbcdsr6yi395xy-source/make-honey.nix:123:34:
122| (l.mapAttrs (machine: checkAndTransformConfig user machine))
123| (l.filterAttrs (_: config: config.nixpkgs.system == system))
| ^
124| (l.mapAttrs (machine: l.nameValuePair "${user}-o-${machine}"))
[...]
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:751:121:
750| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
751| in throw "A definition for option `${showOption loc}' is not of type `${type.description}'. Definition values:${showDefs allInvalid}"
| ^
752| else
… while evaluating the attribute 'mergedValue'
[ ... ]
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/options.nix:342:10:
341| prettyEval = builtins.tryEval
342| (lib.generators.toPretty { }
| ^
343| (lib.generators.withRecursion { depthLimit = 10; throwOnDepthLimit = false; } def.value));
… while evaluating anonymous lambda
[ ... ]
error: attribute 'pkgs' missing
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:467:28:
466| builtins.addErrorContext (context name)
467| (args.${name} or config._module.args.${name})
| ^
468| ) (lib.functionArgs f);
… while evaluating the module argument `pkgs' in "/nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/nixos/modules/profiles/installation-device.nix":
… while evaluating anonymous lambda
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:465:44:
464| context = name: ''while evaluating the module argument `${name}' in "${key}":'';
465| extraArgs = builtins.mapAttrs (name: _:
| ^
466| builtins.addErrorContext (context name)
… from call site
… while evaluating 'id'
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/trivial.nix:14:5:
13| # The value to return
14| x: x;
| ^
15|
… from call site
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/generators.nix:272:47:
271| let
272| evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
| ^
273| in
… while evaluating anonymous lambda
| 16:11:45 |
@blaggacao:matrix.org | Above all, this looks like a boundary violation of lib.evalModules itself, which appears to depend on pkgs, but without ensuring it. | 16:12:30 |
@blaggacao:matrix.org | * Above all, this looks like a boundary violation of lib.evalModules itself, which appears to depend on pkgs, but without apparently ensuring its presence. | 16:12:49 |
@blaggacao:matrix.org | ... or maby that's rather a side offect of wanting to eval a particular module, whithout (me) ensuring said contract, but as soon as I add something reasonable as pkgs, I get an infinite recursion. | 16:13:55 |
@blaggacao:matrix.org | error: infinite recursion encountered
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:712:9:
711| in warnDeprecation opt //
712| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
713| inherit (res.defsFinal') highestPrio;
(use '--show-trace' to show detailed location information)
| 16:15:37 |
@blaggacao:matrix.org | coming somewhere from there:
at /nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/lib/modules.nix:728:137:
727| defs' = concatMap (m:
728| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
729| ) defs;
… while evaluating definitions from `/nix/store/5y5ndnbgvv6mfknnxv48v1swznc5g6wx-source/nixos/modules/installer/cd-dvd/installation-cd-base.nix':
| 16:17:22 |
@blaggacao:matrix.org | (modules/installer/cd-dvd/installation-cd-base.nix) | 16:17:37 |
@blaggacao:matrix.org | I think I found it, regular modules accessing config.system is recursive... | 16:40:04 |
@blaggacao:matrix.org |  Download image.png | 17:23:55 |
@blaggacao:matrix.org | Zhaofeng Li: the streaming evaluator shows this warning (--gc-roots-dir) (fysa) | 17:24:05 |
@blaggacao:matrix.org | And this fixed my above problem 😄 https://github.com/divnix/hive/commit/e1baaaec17524abb5cc00377082cebe8d738a238 | 17:24:53 |
@blaggacao:matrix.org | * And this fixed my above problem 😄 https://github.com/divnix/hive/commit/f532568755835426047a60ca215b764480b10e57 | 17:25:56 |
Zhaofeng Li | In reply to @blaggacao:matrix.org
Hi Zhaofeng Li !
I beleive colmena eval was only ever made to be impure (so the --impure option might be a mistake), see builtins.currentSystem in:
introspect = f:
f {
lib = nixpkgs.lib // builtins;
pkgs = nixpkgs.legacyPackages.${builtins.currentSystem};
nodes = l.mapAttrs (evalNode {_module.check = false;}) comb;
};
Hmm, could you link the code? The current implementation is: https://github.com/zhaofengli/colmena/blob/956c3363b875695fba30a5a8033dc543c2cd4326/src/nix/hive/eval.nix#L193 | 20:08:18 |
Zhaofeng Li | Ah, it's in your make-honey.nix, missed it. But the options should be passed correctly and there is no --impure:
$ colmena eval -E '{...}: builtins.currentSystem'
warning: Git tree '/home/zhaofeng/Git/fleet' is dirty
[INFO ] Using flake: git+file:///home/zhaofeng/Git/fleet?dir=nix
error: attribute 'currentSystem' missing
| 20:14:46 |
@blaggacao:matrix.org | I just made a make-mead for nixos-generators, works pretty much the same way (and thereby makes colmena and nixos-generate two CLI of the same kind, sort of). Required really just a very small fix to nixos-generators | 21:13:34 |
@blaggacao:matrix.org | make-mead | 21:18:00 |
@blaggacao:matrix.org | Zhaofeng Li: re https://github.com/NixOS/nix/pull/6530#issuecomment-1288195277
I wonder if there is a possibility to leverage the nix bundler interface instead of making a synthetic wrapper-flake...
But I haven't really dug deep on this, just planning to do this for styx...
| 22:41:37 |
| 31 Oct 2022 |
@v:meowy.tech |  Download image.png | 07:54:15 |
@v:meowy.tech | running into this error when provisioning a new machine, anyone know what could cause this or how to fix it? | 07:54:36 |
Zhaofeng Li | In reply to @v:meowy.tech sent an image. There isn't a username in ssh-ng://your_ip, did you set deployment.targetUser to null? If so, then the default user it connects as (same as your username if you didn't configure anything) isn't trusted by the Nix daemon | 09:17:06 |
@v:meowy.tech | In reply to @zhaofeng:zhaofeng.li There isn't a username in ssh-ng://your_ip, did you set deployment.targetUser to null? If so, then the default user it connects as (same as your username if you didn't configure anything) isn't trusted by the Nix daemon ah yeah that's likely it, thanks | 09:39:34 |
| 2 Nov 2022 |
| Yuu Yin joined the room. | 00:49:52 |
@rendakuenthusiast:imperishable.name | once I've transitioned a nixos server onto colmena, what's the correct thing to do with the existing /etc/nixos/configuration.nix file? | 01:25:46 |
@rendakuenthusiast:imperishable.name | presumably that file no longer has any relationship to the actual configuration of the server? | 01:26:05 |