Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flake from the Template fails to build #1366

Closed
mirosval opened this issue Oct 26, 2023 · 1 comment · Fixed by #1368
Closed

Flake from the Template fails to build #1366

mirosval opened this issue Oct 26, 2023 · 1 comment · Fixed by #1368

Comments

@mirosval
Copy link

Describe the issue

When I start a new project using the Flake Template, I get error: attribute 'legacyPackages' missing.

❯ nix build
warning: Git tree '/Users/mirosval/work/tests/poetry' is dirty
warning: creating lock file '/Users/mirosval/work/tests/poetry/flake.lock'
warning: Git tree '/Users/mirosval/work/tests/poetry' is dirty
error:
       … while evaluating the attribute 'packages.aarch64-darwin.myapp'

         at /nix/store/r04lcfxjaqj6v96fjzd9l053fw8yn4zm-source/flake.nix:22:11:

           21|         packages = {
           22|           myapp = mkPoetryApplication { projectDir = self; };
             |           ^
           23|           default = self.packages.${system}.myapp;

       error: attribute 'legacyPackages' missing

       at /nix/store/r04lcfxjaqj6v96fjzd9l053fw8yn4zm-source/flake.nix:17:18:

           16|         # see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
           17|         inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
             |                  ^
           18|         pkgs = nixpkgs.legacyPackages.${system};

Additional context

I'm trying to integrate poetry2nix into a flake-based project but can't figure out where to find mkPoetryApplication given

    poetry2nix = {
      url = "github:nix-community/poetry2nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

in the inputs and the only example in this repo that I was able to find is the template, which is also broken it seems.

@cpcloud
Copy link
Collaborator

cpcloud commented Oct 26, 2023

Thanks for the issue!

I've put up #1368 to fix this, and I've added a test to catch future regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants