I am unable to get nix-plugins to work, but am not sure what I’m doing wrong (or if the problem is with nix-plugins).
I have an extra-builtins.nix file that looks like this:
{ exec, ... }: {
hello = exec ["echo" "\"hello\""];
}
And I used the patch from error: could not dynamically open plugin file · Issue #20 · shlevy/nix-plugins · GitHub to build nix-plugins (otherwise I get the error mentioned on that issue).
But when I run nix repl --option plugin-files /nix/store/zwf1zjfkpcbxp1008gxqjpxr223w18ih-nix-plugins-15.0.0/lib/nix/plugins --option extra-builtins-file ./extra-builtins.nix
I find that builtins.extraBuiltins is null, and so builtins.extraBuiltins.hello fails with error: expected a set but found null: null
Using an absolute path to the extra builtins file makes no difference.
Am I doing something wrong, or is nix-plugins not working with the latest version of nix, even with the patch from the gh issue? I assume the former, but I can’t see what it could be. I found various dotfiles repositories using nix-plugins, but couldn’t find anything in any of those that made it work for me.
(My approach is based on Secure, Declarative Key Management with NixOps, Pass, and nix-plugins and Evaluation time secrets in Nix: Importing encrypted nix files | oddlama's blog , but at the moment I’m just trying to get the most basic thing working).