IFD error with hydra job in flake
I'm trying to migrate a shared repo over to using the NUR, instead of using the rycee repo directly for firefox-addons, but I am getting IFD errors with nix flake show & nix flake check when I include my hydraJobs. Please let me know if there's a better place to raise this issue, as this seems like an intersection of a few different things at once.
Details to reproduce:
The hydra jobs themselves are working fine, and when i remove them nix flake show works as expected. Adding nixConfig.allow-import-from-derivation = true to the flake config fixes nix flake check, but not nix flake show. Adding --option allow-import-from-derivation true fixes both issues.
Hydra build URL: https://hydra.alicehuston.xyz/eval/224954
IFD error
error:
… while calling the 'head' builtin
at /nix/store/ma9kq317xbd06aq9hr36mhmjwh7sgl8a-source/lib/attrsets.nix:1575:11:
1574| || pred here (elemAt values 1) (head values) then
1575| head values
| ^
1576| else
… while evaluating the attribute 'value'
at /nix/store/ma9kq317xbd06aq9hr36mhmjwh7sgl8a-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: cannot build '/nix/store/6jbf8rxsmq8bl33mk709a7ng4vilnz61-source.drv^out' during evaluation because the option 'allow-import-from-derivation' is disabled
flake.nix
hydraJobs = import ./hydra/jobs.nix { inherit inputs outputs; };
hydra config:
{ inputs, outputs }:
let
inherit (inputs.nixpkgs.lib) mapAttrs;
getCfg = _: cfg: cfg.config.system.build.toplevel;
in
{
inherit (outputs) formatter devShells;
hosts = mapAttrs getCfg outputs.nixosConfigurations;
}
base config
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules =
[ inputs.sops-nix.homeManagerModules.sops
inputs.nur.hmModules.nur ];
extraSpecialArgs = {
inherit inputs;
machineConfig = {
inherit (machineConfig) server system;
};
};
};
and the home-manager config with NUR
{
pkgs,
config,
machineConfig,
...
}:
let
ff-ext = config.nur.repos.rycee.firefox-addons;
in
{
programs.firefox = {
enable = true;
profiles.richie = {
extensions = with ff-ext; [
bitwarden
darkreader
dearrow
fastforwardteam
return-youtube-dislikes
sponsorblock
ublock-origin
];
};
}
Unfortunately all the fetchers we currently using, require IFD https://github.com/nix-community/NUR/blob/0ef9c5ede0ed044be738087bedbcc161f92b1d48/lib/repoSource.nix#L34C8-L34C16 However it might be possible to use builtin fetcher and load the json here directly:
https://github.com/nix-community/NUR/blob/master/repos.json.lock
i.e. using builtins.fetchgit on a revision field
Okay yeah I had a feeling y'all would say something like that given the setup. Let me see if I can put something together and I'll get back if it's borked. If you want to close this in the meantime that's okay with me. Thanks for pointing me towards the fetcher logic!
Otherwise I believe hydra has it's own nix configuration if I remember correctly? Or was this just for remote builder configuration? The component that does the eval is called hydra-eval-jobs.