Understand how overrides interact with `poetry.lock`
masterWhen using Nix to override a package version, the Nix override supersedes the version specified in poetry.lock.
If poetry.lock specifies version 1.0 for foobar, but your Nix configuration overrides foobar to version 2.0, the resulting build will use version 2.0. This can lead to discrepancies between your lock file and your actual Nix build environment.
let poetryOverrides = final: prev: {
foobar = prev.foobar.overridePythonAttrs (old: rec {
version = "2.0";
src = prev.pkgs.fetchFromGitHub {
owner = "fakerepo";
repo = "foobar";
rev = "refs/tags/${version}";
sha256 = lib.fakeSha256;
};
});
};
in
poetry2nix.mkPoetryApplication {
projectDir = ../.;
overrides = poetry2nix.overrides.withDefaults poetryOverrides;
}