Merge pull request #55 from nix-community/poetry2nix-overrides

Provide withDefaults and withoutDefaults
This commit is contained in:
adisbladis 2020-02-25 13:43:14 +00:00 committed by GitHub
commit e416555959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 13 deletions

View file

@ -261,4 +261,25 @@ in
in
defaultSet // customSet;
};
/*
Convenience functions for specifying overlays with or without the poerty2nix default overrides
*/
overrides = {
/*
Returns the specified overlay in a list
*/
withoutDefaults = overlay: [
overlay
];
/*
Returns the specified overlay and returns a list
combining it with poetry2nix default overrides
*/
withDefaults = overlay: [
defaultPoetryOverrides
overlay
];
};
}

View file

@ -6,9 +6,7 @@ poetry2nix.mkPoetryApplication {
poetrylock = ./poetry.lock;
src = lib.cleanSource ./.;
overrides = [
poetry2nix.defaultPoetryOverrides
(import ./poetry-git-overlay.nix { inherit pkgs; })
];
overrides = poetry2nix.overrides.withDefaults
(import ./poetry-git-overlay.nix { inherit pkgs; });
}

View file

@ -6,8 +6,7 @@ let
src = ./.;
poetrylock = ./poetry.lock;
pyproject = ./pyproject.toml;
overrides = [
poetry2nix.defaultPoetryOverrides
overrides = poetry2nix.overrides.withDefaults
(
self: super: {
alembic = super.alembic.overrideAttrs (
@ -16,8 +15,7 @@ let
}
);
}
)
];
);
};
in
runCommand "test" {} ''

View file

@ -6,8 +6,7 @@ let
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
src = lib.cleanSource ./.;
overrides = [
poetry2nix.defaultPoetryOverrides
overrides = poetry2nix.overrides.withDefaults
# This is also in overrides.nix but repeated for completeness
(
self: super: {
@ -15,9 +14,7 @@ let
preferWheel = true;
};
}
)
];
);
};
url = lib.elemAt drv.passthru.python.pkgs.maturin.src.urls 0;