| 2 Nov 2023 |
adisbladis | In reply to @virtu:matrix.im
In the latest flake template from poetry2nix, inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication; is used so mkPoetryApplication can be used in the output.
How can I use mkPoetryApplication if I'm not using flake-utils?
That has nothing to do with flake-utils or not | 12:02:55 |
virtu | adisbladis: you're certainly right. I'm just having difficulty translating the statement to the code that's used by the flake python template. In poetry2nix's template, it's:
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
In the flake python template, it's:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
in
| 12:05:05 |
adisbladis | Is your repo public somewhere? It's a bit hard to tell where things go wrong without more context. | 12:06:13 |
virtu | if I just copy the inherit, it won't work, because it expects pkgs to be a particular system's instance of the packages. | 12:06:22 |
adisbladis | This is totally ugly, but you could probably get away with it: pkgs = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; in pkgs // { poetry2nix = poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }; }) | 12:10:21 |
adisbladis | Basically we're injecting a poetry2nix attribute on top of nixpkgs, so no other changes should be needed if you previously used it from nixpkgs | 12:11:49 |
virtu | thanks! | 12:15:17 |
nazarewk | i've trouble with infinite recursion when trying to use out-of-tree poetry2nix, anyone else had such issues? | 12:27:27 |
K900 | Update it | 12:31:41 |
K900 | Should be fixed now | 12:31:45 |
nazarewk | I did just create the project (actually moving from flakes to devenv.nix), so the version is latest | 12:36:09 |
K900 | And what nixpkgs version are you on? | 12:39:17 |
nazarewk | I'm trying to determine what is different, because in here it seems to be working fine | 12:43:04 |
nazarewk | but I have a second (private) repo moving from flakes to devenv.nix (too much trouble to maintain flake) where it doesn't work | 12:43:46 |
K900 | Are you using nixpkgs-unstable? | 12:45:02 |
nazarewk | yeah | 12:45:09 |
K900 | It needs to be nixpkgs-unstable for latest poetry2nix | 12:45:09 |
K900 | If it's still looping, it might just be a bug | 12:45:16 |
K900 | Or you might have a circular dependency somewhere | 12:45:22 |
K900 | That happens | 12:45:23 |
nazarewk | oh wait | 12:45:24 |
nazarewk | is it nixpkgs-unstable or nixos-unstable? | 12:46:33 |
K900 | Either one | 12:49:39 |
nazarewk | both seem to have nixpkgs at 0cbe9f69c234a7700596e943bfae7ef27a31b735 and poetry2nix at 349143fce1c8c38255fb8a8d99e2c0cd5854889c | 12:57:53 |
nazarewk | seems like I cannot use any poetry2nix package whatsoever in the private repo | 13:03:31 |
nazarewk | might be something weird with devenv, but I'm not sure what could it be | 13:03:54 |
nazarewk | I think it's loading too much of something at once at some point... | 13:22:13 |
nazarewk | yeah, devenv seems to be at fault here | 13:25:29 |
nazarewk | here we go with a bug report https://github.com/cachix/devenv/issues/859 | 14:26:13 |
nazarewk | I did create a working flake-only version and not working (pretty much OOTB after adding input) devenv configuration | 14:29:08 |