| 21 Mar 2024 |
l0b0 | Is it just me or is poetry2nix still much simpler in Nix shell than using flakes? | 02:05:17 |
l0b0 | * Is it just me or is poetry2nix still much simpler in Nix shell than using flakes? In flakes there seems to be these extra inputs.nixpkgs.follows = "nixpkgs"; and poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) steps which seem redundant. | 02:06:27 |
Charles | just don't do the former | 02:58:16 |
l0b0 | I can't find any good documentation of any of this, so I've just reverted to using Nix shells. Much simpler. | 03:05:23 |
Charles | of what, follows? | 03:06:39 |
l0b0 | How to use poetry2nix with flakes. This doesn't really explain anything. | 03:07:46 |
l0b0 | I tried using it, and the resulting config is much more complex than a Nix shell. | 03:08:13 |
Charles | https://github.com/nix-community/poetry2nix/blob/3c92540611f42d3fb2d0d084a6c694cd6544b609/templates/app/flake.nix#L18 | 03:08:57 |
Charles | i do poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }; though so i can reuse poetry2nix instead of just the 1 builder | 03:09:33 |
l0b0 | Still doesn't explain anything. | 03:09:42 |
l0b0 | Why is there even a mkPoetry2Nix? Why would it not be enough to use poetry2nix directly? | 03:10:13 |
Charles | then instead of https://github.com/nix-community/poetry2nix/blob/3c92540611f42d3fb2d0d084a6c694cd6544b609/templates/app/flake.nix#L22 you would do poetry2nix.mkPoetryApplication to refer to the binding i mentioned in my previous message | 03:10:16 |
Charles | In reply to @vengmark2:matrix.org Why is there even a mkPoetry2Nix? Why would it not be enough to use poetry2nix directly? because they want to take pkgs explicitly to function kinda like an overlay | 03:10:32 |
Charles | instead of using its own instance of nixpkgs | 03:10:38 |
l0b0 | Isn't inputs.nixpkgs.follows = "nixpkgs"; explicit enough? | 03:11:55 |
l0b0 | It probably does something completely different, but as a developer this whole syntax is incredibly confusing. | 03:12:29 |
Charles | that is different | 03:12:47 |
l0b0 | Nothing should need to take two references to something else. | 03:12:55 |
Charles | that's a different instance of the same nixpkgs | 03:13:01 |
l0b0 | That's bad DX | 03:13:15 |
Charles | the difference being that overlays you apply to your own pkgs would not be observable by poetry2nix (or any other flake input) | 03:13:28 |