Allow insecure packages in flake.nix

Just replace

nixpkgs.legacyPackages.${system}

with

(import nixpkgs {
  inherit system;
  config = {
    permittedInsecurePackages = [
      "foo"
    ];
  };
})

That is basically how legacyPackages are defined in Nixpkgs:

Though see the discussion in Using nixpkgs.legacyPackages.${system} vs import for caveats.

3 Likes