-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
47 lines (45 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pythonPackageOverlay = final: prev: rec {
python = prev.python312.override {
packageOverrides = pFinal: pPrev: rec {
# You can override packages or add packages that are not in nixpkgs
fastapi = pPrev.buildPythonPackage rec {
pname = "fastapi";
version = "0.115.6";
pyproject = true;
build-system = [
pPrev.pdm-backend
];
dependencies = with pPrev; [
starlette
pydantic
typing-extensions
];
src = pPrev.fetchPypi {
inherit pname version;
hash = "sha256-nsRvet3BTqRylYqWquW13mXzlyGkaq9XBcSA2ai3ZlQ=";
};
};
};
};
};
pkgs = import nixpkgs { inherit system; overlays = [ pythonPackageOverlay ]; };
python = (pkgs.python.withPackages (p: with p; [
# Add packages you want to use
fastapi
]));
in
{
devShell = pkgs.mkShell {
packages = [ python pkgs.pyright ];
};
}
);
}