Switch to Svelte
This commit is contained in:
20
flake.nix
20
flake.nix
@@ -18,6 +18,19 @@
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
python = pkgs.python3;
|
||||
|
||||
# Build the Svelte frontend
|
||||
frontend = pkgs.buildNpmPackage {
|
||||
pname = "pirats-frontend";
|
||||
version = "0.1.0";
|
||||
src = ./frontend;
|
||||
npmDepsHash = "sha256-ekYBi0oUjtnsfdig2B0yrmT7KbSc9IB1DVbTCRwYI24=";
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r dist $out/
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
default = python.pkgs.buildPythonApplication {
|
||||
@@ -35,7 +48,6 @@
|
||||
fastapi
|
||||
sqlmodel
|
||||
uvicorn
|
||||
jinja2
|
||||
python-multipart
|
||||
httpx
|
||||
];
|
||||
@@ -43,6 +55,11 @@
|
||||
nativeCheckInputs = with python.pkgs; [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p src/pirats/static
|
||||
cp -r ${frontend}/dist/* src/pirats/static/
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "pirats" ];
|
||||
};
|
||||
@@ -59,6 +76,7 @@
|
||||
inputsFrom = [ self.packages.${system}.default ];
|
||||
packages = with pkgs; [
|
||||
pkgs.python3.pkgs.pytest
|
||||
pkgs.nodejs
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user