64 lines
1.5 KiB
Nix
64 lines
1.5 KiB
Nix
{
|
|
description = "Development flake for the HTMX folkugat web";
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
python = pkgs.python311;
|
|
pythonPackages = pkgs.python311Packages;
|
|
|
|
# custom-python = import ./custom-python.nix { inherit pkgs; };
|
|
|
|
coreDependencies = with pythonPackages; [
|
|
# IDE tools
|
|
pylsp-mypy
|
|
isort
|
|
autopep8
|
|
# Development tools
|
|
pytest
|
|
setuptools
|
|
ipython
|
|
];
|
|
|
|
projectDependencies = with pythonPackages; [
|
|
# API
|
|
fastapi
|
|
python-multipart
|
|
jinja2
|
|
uvicorn
|
|
# Files
|
|
magic
|
|
# Auth
|
|
pyjwt
|
|
# Search
|
|
levenshtein
|
|
];
|
|
|
|
pythonEnv = python.withPackages (
|
|
ps: projectDependencies ++ coreDependencies
|
|
);
|
|
|
|
in {
|
|
devShells.default = pkgs.mkShell {
|
|
# nativeBuildInputs = [ pkgs.bashInteractive ];
|
|
buildInputs = with pkgs; [
|
|
# Python dependencies
|
|
python
|
|
pythonEnv
|
|
pyright
|
|
black
|
|
# Project dependencies
|
|
nodePackages_latest.tailwindcss
|
|
];
|
|
|
|
shellHook = ''
|
|
export PYTHONPATH=${pythonEnv}/${python.sitePackages}:$PYTHONPATH
|
|
'';
|
|
};
|
|
});
|
|
}
|