forked from nix-community/poetry2nix
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
40 lines (34 loc) · 1.08 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
description = "Poetry2nix flake";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs, flake-utils }:
{
overlay = import ./overlay.nix;
templates = {
app = {
path = ./templates/app;
description = "An example of a NixOS container";
};
default = self.templates.app;
};
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
poetry2nix = import ./default.nix { inherit pkgs; };
poetry = pkgs.callPackage ./pkgs/poetry { python = pkgs.python3; inherit poetry2nix; };
in
rec {
packages = {
inherit poetry;
poetry2nix = poetry2nix.cli;
default = poetry2nix.cli;
};
legacyPackages = poetry2nix;
apps = {
poetry = flake-utils.lib.mkApp { drv = packages.poetry; };
poetry2nix = flake-utils.lib.mkApp { drv = packages.poetry2nix; };
default = apps.poetry2nix;
};
}));
}