-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
49 lines (45 loc) · 1.28 KB
/
flake.nix
File metadata and controls
49 lines (45 loc) · 1.28 KB
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
{
description = "functional domain modeling";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pythonEnv = pkgs.python313;
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pythonEnv
pyright
uv
direnv
nix-direnv
pre-commit
entr
gnumake
];
# Use nix-ld when on NixOS, because ruff depends on libc:
NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
stdenv.cc.cc
];
# Let uv use the python version of this flake by default:
UV_PYTHON = pythonEnv.interpreter;
};
apps.develop = flake-utils.lib.mkApp {
drv = pkgs.writeShellApplication {
name = "develop";
runtimeInputs = with pkgs; [
pythonEnv
];
text = ''
fastapi dev "$PROJECT_ROOT/src/$PROJECT_NAME/main.py"
'';
};
};
formatter = pkgs.nixpkgs-fmt;
});
}