You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having to deal with an existing 3rd party poetry.lock file, it might happen that some of the dependencies in there have benn marked as insecure in nixpkgs. Current examples are openssl_1_1 or some older versions of python-requests.
Using insecure packages is not nice, but at times necessary.
To allow the usage of these packages, the nixpkgs config attribute permittedInsecurePackages needs to be modified.
In a flake with the 2 inputs nixpkgs and poetry2nix, just instantiating nixpkgs with a new config is not enough as the poetry2nix flake also takes nixpkgs as an input. And this input is not affected by the re-configuration within the flake outputs body.
I'd like to know whether there are existing best practices for this. maybe we can document them? If not, there might be a need to provide nixpkgs config to the poetry2nix flake from the outside?
suggestion
I managed to solve this issue by using a separate sub-flake to configure and then re-export nixpkgs. This sub-flake output is then fed into both poetry2nix via follows and used instead of the main nixpkgs in the main flake.
# vaguely inspired by https://github.com/numtide/nixpkgs-unfree/blob/9545d844027c1b91b14b19d225856efc931b22b2/flake.nix{description="nixpkgs reexported with some required configuration, e.g. permitted insecure packages";outputs=inputs@{self,nixpkgs}:
letinherit(nixpkgs)lib;# re-use same supported systems as in the upstream nixpkgssystems=lib.systems.flakeExposed;forEachSystem=lib.genAttrssystems;nixpkgsConfig={permittedInsecurePackages=["openssl-1.1.1w"];};innixpkgs//{legacyPackages=forEachSystem(system:
importnixpkgs{inheritsystem;config=nixpkgsConfig;});};}
Describe the issue
When having to deal with an existing 3rd party
poetry.lock
file, it might happen that some of the dependencies in there have benn marked as insecure in nixpkgs. Current examples are openssl_1_1 or some older versions of python-requests.Using insecure packages is not nice, but at times necessary.
To allow the usage of these packages, the nixpkgs config attribute
permittedInsecurePackages
needs to be modified.In a flake with the 2 inputs
nixpkgs
andpoetry2nix
, just instantiating nixpkgs with a new config is not enough as thepoetry2nix
flake also takes nixpkgs as an input. And this input is not affected by the re-configuration within the flakeoutputs
body.I'd like to know whether there are existing best practices for this. maybe we can document them? If not, there might be a need to provide nixpkgs config to the poetry2nix flake from the outside?
suggestion
I managed to solve this issue by using a separate sub-flake to configure and then re-export nixpkgs. This sub-flake output is then fed into both
poetry2nix
viafollows
and used instead of the main nixpkgs in the main flake.the toplevel
flake.nix
:The sub-flake flakeSupport/myNixpkgs/flake.nix:
Note that event this solution is a bit buggy, as it triggers re-locking of
flake.lock
at each evaluation.The text was updated successfully, but these errors were encountered: