I have been working on some updates to nix-node, which allows installation of multiple versions of nodejs, including older versions that are no longer supported:
This has been working, except that the versions of node that are no longer officially supported are marked as insecure and cannot be installed or built. For example, attempting to build version 16.18.0 returns this error:
error: Package ‘nodejs-16.18.0’ in /nix/store/vkf7qqw2pmpxfhs5axsjmv1sbwdkqzhs-source/flake.nix:305 is marked as insecure, refusing to evaluate.
In trying to update the package to allow these versions to be installed, I have been following these sources:
Unfortunately I’m a bit of a nix noob and cannot work out how to apply these changes to the existing flake.nix:
My naive attempts to slot similar code in have either resulted in syntax errors, or simply don’t work. Would anyone be able to let me know where I should set the permittedInsecurePackages list in the above code?
error:
… while checking flake output 'packages'
at /nix/store/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source/lib.nix:43:9:
42| // {
43| ${key} = (attrs.${key} or { }) // {
| ^
44| ${system} = ret.${key};
… while checking the derivation 'packages.x86_64-linux.default'
at /nix/store/xkfk5j5f3kf2pw6y3mxific86r4cg789-source/flake.nix:48:9:
47|
48| packages.default = nixpkgs.legacyPackages.${system}.buildGoModule {
| ^
49| pname = "signasl";
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: Package ‘olm-3.2.16’ in /nix/store/22r7q7s9552gn1vpjigkbhfgcvhsrz68-source/pkgs/by-name/ol/olm/package.nix:31 is marked as insecure, refusing to evaluate.
…plus a bunch of informational output that I didn’t include.
I’m having the same issue. I’m trying to disable the security check for the python ecdsa package that’s insecure in a flake I’m working on. I don’t want to enable for the whole system because it’s actually a security hole, but not the way it’s used by the program I want to work with.
I can attempt to use the flake anyway if I add NIXPKGS_ALLOW_INSECURE=1 to the environment, but that’s what I’m trying to avoid. It then promptly fails because nix pulls the wrong click for it but I’ll be posting a ticket about that after I mess about a bit more.
I’m in the wheel group and I’ve made it a trusted user.
I did also try with –impure when NOT setting the environment variable and expecting the config in this flake to solve it.