HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
nix-community
poetry2nix
Nix2019–2024
nix-community / poetry2nix

poetry2nix

Convert poetry projects to nix automagically [maintainer=]

14Distinct people
20Mentions
0Explicit recommenders
923GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Convert poetry projects to nix automagically [maintainer=]

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 1:02:30 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year20 dated mentions

Observed mentions: 2019-12-13 15:55:42 UTC to 2024-12-05 02:34:33 UTC.

02462019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC606
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC606

What Hacker News says

6 sources
There are multiple ways of doing it. The obvious one (updating nixpkgs) you already mentioned. Second way is to override[1], in documentation they are showing how to change compilation parameters, but you can also use this to change version of dependencies or source tarball for the package. As you use Nix you will eventually need to do it as sometimes package was not updated, or perhaps you need to use older version, or enable compilation option. Third way is to use overlay[2]. In previous way an existing package was modified. Overlay allows to completely replace or add a new one. For example there is a tool called poetry2nix[3], which on the fly translates python poetry lock file to Nix so nix can build them. Nixpkgs includes it and generally is frequently updated, but maybe there was a fix yesterday that hadn't made it there yet and it
Read the rest
fixes an important bug. You can fetch that repo independently and attach it to nixpkgs (or you can use it directly). Nix also has upcoming feature flakes which to my understanding takes this to a new level. So you can easily compose multiple repos like this in your application. > Theres clearly more to Nix than just setting up language environments, which I'm guessing is where its usefuleness really kicks in. But purely for lang env set up, I'm not sure I see a point over other tooling... I use it this way and the killer feature for myself is that for a project all I need to have installed is Nix and I can have exact environment the dev used. It's not mentioned often, but I think a demo of it would be the repo for Nix program[4]. Typically when you want to compile some open source program, after you check out the repo, a hunt starts for the building tools and libraries needed. With nix you just issue build command or enter build shell[5] and things just work with no errors (or at least I did not get them when trying it a while ago. Everything worked on first try). [1] https://nixos.org/manual/nixpkgs/stable/#chap-overrides [2] https://nixos.org/manual/nixpkgs/stable/#chap-overlays [3] https://github.com/nix-community/poetry2nix [4] https://github.com/nixos/nix [5] https://hydra.nixos.org/build/153568733/download/1/manual/co...
In Ditch your version manager
nix-env -i -f '<nixpkgs>' -E 'f: (f {}).python3.withPackages (ps: with ps; [pyyaml requests])' But you don't want to install globally. One of major strengths (for me at least) is that when combined with nix-shell you have something like virtualenv, but for all packages, not just the ones from python. This means that someone else who checks out your project can get the same environment you had for the development. If this is combined with direnv, then you don't even need to invoke nix-shell you just enter the project directory and everything is there. If you use something like poetry2nix[1] it will automatically have the dependencies your project has. [1] https://github.com/nix-community/poetry2nix
In macOS Nix setup: an alternative to Homebrew (2020)
So I haven't used mach-nix, but from what I see it provides its own way of specifying dependencies. While in case of poetry2nix you are using poetry for dependency management and poetry2nix just translates it to Nix. The biggest benefit for using poetry is the dependency resolver which is much smarter than in pip and actually finds packages that match the version requirements (although looks like mach-nix also has a smart resolver. Other benefits are: * nice CLI * ability to package application and upload to PyPI * poetry can still be used by people who don't use Nix Regarding non-python dependencies, this is solved by overrides file[1]. That way most of the time you don't have to think about it. You can also override the override in your project as well. [1] https://github.com/nix-community/poetry2nix/blob/master/over...
In NixOS 21.05
Yes, it's extremely powerful once you truly understand Nix. There are efforts to improve documentation, but it still is lacking (I think the biggest problem is that Nix is so big, not just the OS but it can be utilized as a build system). Just with NixOS is not exactly clear how can you for example build your custom image. I think https://nix.dev/ is approaching the documentation from the right direction. There are also many pieces that people built that you need to find. For example some things that I found accidentally: * https://github.com/nix-community/poetry2nix * https://github.com/matthewbauer/nix-bundle * https://github.com/cleverca22/not-os Unfortunately those side projects often have even worse documentation.
In NixOS 21.05

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.