From 7ee840c28a32be6a40180f2e32de2f76ed2cf4fa Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 17 Feb 2025 03:27:49 -0800 Subject: [PATCH] Fix flake to build with vite --- flake.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 3c70817..692dc75 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,7 @@ buildInputs = with pkgs; [ openssl sqlite + nodejs_20 ]; in { devShells.default = pkgs.mkShell { @@ -53,10 +54,17 @@ inherit nativeBuildInputs buildInputs; - # Copy static files to the output + # Build the Vite assets and copy them to the output + preInstall = '' + cd static + npm install + npm run build + cd .. + ''; + postInstall = '' mkdir -p $out - cp -r static $out + cp -r static/dist $out/static cp -r templates $out '';