!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

314 Members
https://github.com/nix-community/poetry2nix59 Servers

Load older messages


SenderMessageTime
22 Nov 2023
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

{
  description = "Complete self-contained pandoc(omatic) flake with templates etc.";
   ...
  outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
      in
        {
          devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
        }
    );
}

but I get an error:

      error: function 'anonymous lambda' called without required argument 'lib'
       at /nix/store/5iviv2i2c2fkb5frjc1apkrymvzhpldc-source/default.nix:1:1:
14:42:28
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

{
  description = "Complete self-contained pandoc(omatic) flake with templates etc.";
   ...
  outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
      in
        {
          devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
        }
    );
}

but I get an error:

error: function 'anonymous lambda' called without required argument 'lib'
       at /nix/store/5iviv2i2c2fkb5frjc1apkrymvzhpldc-source/default.nix:1:1:

The content of the nix path in the error is the default.nix from the xls2latex repo. (And the pandoc shell simply refers to the xls2latex package from pkgs for the build inputs..
14:45:47
@ppenguin:matrix.orgppenguinRedacted or Malformed Event15:05:54
@ppenguin:matrix.orgppenguin Following this pattern I managed to solve the error, the only funky thing(?) now is that I have flake outputs like this: overlays.${system}.default, which seems a bit unusual, but I need pkgs (system dependent) for the callPackage, so chicken & egg problem? 15:12:48
23 Nov 2023
@jsimonrichard:matrix.orgSimon Richard joined the room.03:23:36
@jsimonrichard:matrix.orgSimon Richard I'm trying to use the development shell generated by the poetry2nix template, but when I run poetry add ... I get [org.freedesktop.DBus.Error.UnknownObject] ("No such object path '/org/freedesktop/secrets/aliases/default'",). Is this likely to be an issue with my host configuration, or is this a bug? (in case it's helpful, my host configuration can be found here: https://github.com/jsimonrichard/nix-config) 03:27:04
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯

Simon Richard: Not entirely sure this is the same issue I had, but I have

          shellHook = ''
            export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
          '';

on my dev shell…

03:48:15
@jsimonrichard:matrix.orgSimon Richard Thanks, that worked! However, the second time I ran nix develop I got the error attribute 'format' missing. I think it's being caused by the pypoetry.toml file or the poetry.lock file since those are the only files that have changed since the first time I ran nix develop. Any thoughts? 14:56:48
25 Nov 2023
@10leej:matrix.org@10leej:matrix.org joined the room.15:56:35
28 Nov 2023
@benbot:matrix.orgBenBot joined the room.14:30:58
@benbot:matrix.orgBenBot

Hey all, is there a newer way to add overrides that isn't in the docs?

I keep getting errors that both poetry2nix.overrides and poetry2nix.defaultPoetryOverrides is missing from poetry2nix

14:31:48
@k900:0upti.meK900 Is poetry2nix your flake? 15:58:08
@k900:0upti.meK900* Is poetry2nix your flake input? 15:58:14
@k900:0upti.meK900Check the flake example in the repo 15:58:20
29 Nov 2023
@benbot:matrix.orgBenBot
In reply to @k900:0upti.me
Is
poetry2nix your flake input?
It was my misunderstanding of how scope works in nix. I got past that, but now there are other problems :(
15:58:06
@benbot:matrix.orgBenBot

we're using protobuf to generate some classes at build time, but I can't figure out how to run protoc during the build phase of makePoetryApplication.

It doesn't seem like whatever mkPoetryApplication outputs has override or overrideAttrs so i'm at a loss 😓

15:58:57
@k900:0upti.meK900Ideally you'd run it as part of your normal Python build15:59:16
@k900:0upti.meK900Probably with a Poetry plugin15:59:30
@benbot:matrix.orgBenBotI'll look into that then. From a quick google search last night, I didn't see an easy way to run a make command or anything like that during poetry's build. But i'm no poetry expert, so i may have missed it16:00:35
@k900:0upti.meK900There isn't16:02:07
@benbot:matrix.orgBenBot this seems like a huge limitation then :(
I'm having a similar issue with an elixir flake. No way to generate protobuf modules before running the mixRelease function in nix
16:02:58
@k900:0upti.meK900Well16:03:08
@k900:0upti.meK900You can do it in Nix16:03:10
@k900:0upti.meK900And then copy in the files16:03:13
@benbot:matrix.orgBenBot

Yeah, that's the hack i have now.

Generate the files in a package named proto then use the $out from that as the projectDir for mkPoetryApplication.

It's weirder for elixir since I need to install a remote dep (a protoc plugin) to generate the modules

16:04:32
@benbot:matrix.orgBenBot

Is there any reason the derivation that mkPoetryApplication returns doesn't have override or overrideAttrs on it?

I feel like just prepending a make python-proto command to the buildPhase would be really simple

16:05:23
@k900:0upti.meK900 It should have overridePythonAttrs 16:06:08
@k900:0upti.meK900But also if you're doing that, you're basically making your thing not buildable without Nix16:06:20
@k900:0upti.meK900Which may or may not be a problem for you16:06:24
@benbot:matrix.orgBenBot I'm okay with that. Currently my build process is a very hacky dockerfile, so anything is better than that 😅
Plus it's just an additional make command
16:07:30

Show newer messages


Back to Room ListRoom Version: 6