27 Sep 2024 |
wecmyrc | In reply to @ericadelagnier:multi.coop the build works ! thank you :) I can now run the app with ./result/bin/hello, but I'm not sure how to call it with gunicorn ? the README suggest "./result/bin/gunicorn web:app" but I'm not sure how to make gunicorn available in the result * I would suggest to add gunicorn in flake.nix buildInputs, and run it from python something like subprocess.Popen(["gunicorn", "web:app"])
Part of flake.nix with buildInputs:
packages = {
app = mkPoetryApplication {
packageName = "app";
projectDir = ./.;
};
buildInputs = with pkgs; [
python312Packages.gunicorn
];
default = self.packages.${system}.app;
};
| 16:38:46 |
28 Sep 2024 |
@ersei:ersei.net | so I'm working on making a PR to fix some build tools issues | 16:51:46 |
@ersei:ersei.net | but psycopg-c also depends on postgresql.dev | 16:51:54 |
@ersei:ersei.net | * but psycopg-c also depends on postgresql.dev | 16:52:00 |
@ersei:ersei.net | what's the best way to handle that kind of override | 16:52:07 |
@ersei:ersei.net | oh I see the issue | 16:54:02 |
@ersei:ersei.net | because psycopg had an override to add postgres to it (not postgresql.dev ) the override to add setuptools was removed | 16:54:29 |
@ersei:ersei.net | yep, can confirm that this is a bug | 16:59:00 |
@ersei:ersei.net | by removing psycopg's override in defaults.nix, the build system for it works | 16:59:16 |
@ersei:ersei.net | I'm not sure how I would go around fixing that though | 16:59:28 |
@ersei:ersei.net | * by removing psycopg's override in defaults.nix, the build system for it works (after adding an overlay to add postgresql.dev back in) | 16:59:46 |
@ersei:ersei.net | * by removing psycopg's override in defaults.nix, the build system for it works (after adding an overlay to add postgresql.dev back in) | 16:59:53 |
@ersei:ersei.net | my guess is that the ordering in lib.composeManyExtensions is not as expected? | 17:01:06 |
@ersei:ersei.net |
The result is produced by using the update operator //. This means nested values of previous overlays are not merged recursively. In other words, previously defined attributes are replaced, ignoring the previous value, unless referenced by the overlay; for example final: prev: { foo = final.foo + 1; }.
| 17:01:53 |
@ersei:ersei.net | *
The result is produced by using the update operator //. This means nested values of previous overlays are not merged recursively. In other words, previously defined attributes are replaced, ignoring the previous value, unless referenced by the overlay; for example final: prev: { foo = final.foo + 1; }.
| 17:02:00 |
@ersei:ersei.net | nvm I was not being smart and forgot to update my flake lockfile when making changes to my local copy | 17:11:25 |
@ersei:ersei.net | I'm not quite sure what exactly was going on but everything builds so | 17:15:48 |
@ersei:ersei.net | anyway made a pr for types-cffi https://github.com/nix-community/poetry2nix/pull/1831 | 17:23:06 |
@ersei:ersei.net | oh someone beat me to the psycopg-c pr and my fork that I was testing with included those changes https://github.com/nix-community/poetry2nix/commit/038825873c3c3c7f9e238384e7324a3e7f7a1b15 | 17:25:24 |
@ersei:ersei.net | makes sense now | 17:25:27 |
30 Sep 2024 |
Erica | Thank you ! would you know a CLI alternative to the python subprocess ? | 08:08:26 |
1 Oct 2024 |
| -_o joined the room. | 21:05:24 |
2 Oct 2024 |
| mirorred_basilisk joined the room. | 14:14:13 |
mirorred_basilisk | Hi, not sure if this is the place for this but does poetry2nix work for installing an existing github repo as a package? i.e. If there's an existing project with poetry.toml etc and I would like to write a flake to install it as a program in my config? | 14:17:48 |
K900 | You don't need a flake for this | 14:18:40 |
K900 | But it could work yes | 14:18:45 |
mirorred_basilisk | In reply to @k900:0upti.me You don't need a flake for this oh really? what's the simpler solution? | 14:19:47 |
mirorred_basilisk | Because after a lot of fiddling I've got a flake that looks like this:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # or a stable version
# Poetry required to build this flake
poetry2nix.url = "github:nix-community/poetry2nix";
};
outputs = { self, nixpkgs, poetry2nix }: {
packages.x86_64-linux.mypackage = with nixpkgs;
# The little incantation to use poetry2nix
let
system = "x86_64-linux";
pkgs = legacyPackages.${system};
poetry2nixLib = poetry2nix.lib.mkPoetry2Nix { inherit pkgs; };
in poetry2nixLib.mkPoetryApplication rec {
pname = "mypackage";
version = "3.2.5";
# Attempt to fetchFromGitHub as the source dir
projectDir = pkgs.fetchFromGitHub {
...
};
meta = with lib; {
...
};
};
};
}
and it's just giving me a recursion error
| 14:19:57 |
K900 | You can just define a package directly in your config | 14:20:00 |
K900 | That is possible on some packages, yes | 14:20:14 |