Closed nrdxp closed 3 years ago
I think I might have spotted a slight mistake.
# ci = recurseIntoAttrs
# default.nixosConfigurations.ci.config.system.build.toplevel;
Here default.nixosConfigurations.ci.config.system.build.toplevel
is a derivation rather than an attrset of derivations. This might throw off agent's evaluator.
Maybe you did intend to use an attrset at first?
let
#...
ci = recurseIntoAttrs {
nixos = default.nixosConfigurations.ci.config.system.build.toplevel;
};
in
{
inherit shell ci;
#...
}
I was able to instantiate it like that. Could you try something like this?
Thanks for the help. I did what you advised, but unfortunately got the exact same error. I also tried building a much simpler NixOS configuration just to ensure it wasn't specific to the ci config, but unfortunately, I still got the same error.
Here's a job with the two failed NixOS configurations.
Is there a way to override the nix version in use by the agent? If so I'd like to try that as well.
I've added trace
calls and discovered the following value
:
trace: DEBUG: firstInvalid
trace: { file = <CODE>; value = /var/lib/hercules-ci-agent/work/eval-45416e0281decdae/arg-src/nixflk; }
trace: DEBUG: defsFinal
trace: [ { file = <CODE>; value = /var/lib/hercules-ci-agent/work/eval-45416e0281decdae/arg-src/nixflk; } ]
So it seems that a path value is passed into the option, rather than a normal string, triggering the error message.
This has to do with the fact that the checkout is not a git repo currently.
To work around it, Nix Flakes' "fetchGit" behavior can be emulated in default
in ci.nix
as follows:
default = (import "${../.}/compat").defaultNix;
In the future, I do plan to fetch via git, but for now it's best to use the workaround.
I was attempting to build a NixOS configuration as part of the ci. My repository is flake based so I am using flake-compat to pass derivations to hercules.
Here is the offending code. I can build this without error like so
nix-build nix/ci.nix -A ci
, but when hercules gets ahold of it, it produces the following error:My only guess is mismatched nix versions, as I am using
nixFlakes
from the 20.09 release.