Skip to content

Commit

Permalink
Merge pull request #1375 from nix-community/flake-cleanups
Browse files Browse the repository at this point in the history
cleanup: reorganize flake a bit, export lib.mkPoetry2Nix as a function
  • Loading branch information
adisbladis authored Oct 26, 2023
2 parents 2d34ce9 + cfc8686 commit 43a7430
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
working-directory: ${{ env.TESTDIR }}
run: nix flake init --template "$GITHUB_WORKSPACE"

- name: force flake to our poetry2nix version
working-directory: ${{ env.TESTDIR }}
run: nix flake lock --override-input poetry2nix "$GITHUB_WORKSPACE"

- name: generate pyproject.toml
working-directory: ${{ env.TESTDIR }}
run: nix develop -c poetry init --name=poetry2nix-template-test --quiet
Expand Down
21 changes: 3 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

{
overlay = import ./overlay.nix;
lib.mkPoetry2Nix = { pkgs }: import ./default.nix { inherit pkgs; };

githubActions =
let
Expand Down Expand Up @@ -71,27 +72,11 @@
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(_: _: {
p2nix-tools = pkgs.callPackage ./tools { };
})
];
config = {
allowAliases = false;
permittedInsecurePackages = [
"python3.8-requests-2.29.0"
"python3.8-cryptography-40.0.2"
"python3.9-requests-2.29.0"
"python3.9-cryptography-40.0.2"
"python3.10-requests-2.29.0"
"python3.10-cryptography-40.0.2"
"python3.11-requests-2.29.0"
"python3.11-cryptography-40.0.2"
];
};
config.allowAliases = false;
};

poetry2nix = import ./default.nix { inherit pkgs; };
p2nix-tools = pkgs.callPackage ./tools { };
in
rec {
formatter = treefmtEval.${system}.config.build.wrapper;
Expand Down
2 changes: 1 addition & 1 deletion templates/app/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
let
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
pkgs = nixpkgs.legacyPackages.${system};
inherit (import poetry2nix { inherit pkgs; }) mkPoetryApplication;
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
in
{
packages = {
Expand Down

0 comments on commit 43a7430

Please sign in to comment.