mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-06 17:51:40 -05:00

This makes the template a lot shorter. Overlays are not only harder to read and understand (especially if multiple of them have to be combined), they also have a real performance impact as each flake would introduce its own instance of nixpkgks, which can further multiply if these flakes are than import into multiple NixOS configurations: https://zimbatm.com/notes/1000-instances-of-nixpkgs If the goal of overlays was here to make importing easier, I would rather recommend looking into https://flake.parts
28 lines
930 B
Nix
28 lines
930 B
Nix
{
|
|
description = "Application packaged using poetry2nix";
|
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
inputs.poetry2nix = {
|
|
url = "github:nix-community/poetry2nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
|
|
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
packages = {
|
|
myapp = mkPoetryApplication { projectDir = self; };
|
|
default = self.packages.${system}.myapp;
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
packages = [ poetry2nix.packages.${system}.poetry ];
|
|
};
|
|
});
|
|
}
|