-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
52 lines (46 loc) · 1.42 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
41
42
43
44
45
46
47
48
49
50
51
52
{
description = "Application packaged using poetry2nix";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/24.05";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
uv2nix_hammer_overrides.url = "github:/TyberiusPrime/uv2nix_hammer_overrides";
uv2nix_hammer_overrides.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
flake-utils,
poetry2nix,
uv2nix_hammer_overrides,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryEnv;
in
{
packages = {
myapp = mkPoetryEnv {
projectDir = self;
python = pkgs.python312;
overrides = [
# defaultPoetryOverrides # depending on wether you want the poetry2nix overrides as well
(uv2nix_hammer_overrides.overrides pkgs)
];
preferWheels = true;
};
};
defaultPackage = self.packages.${system}.myapp;
# Shell for app dependencies.
devShells.default = pkgs.mkShell { inputsFrom = [ self.packages.${system}.myapp ]; };
# Shell for poetry.
devShells.poetry = pkgs.mkShell { packages = [ pkgs.poetry ]; };
}
);
}