feat: Add Nix app to serve frontend with Python HTTP server
This commit is contained in:
parent
fc1b37333b
commit
b8265ae360
13
flake.nix
13
flake.nix
@ -27,6 +27,14 @@
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r dist/* $out/
|
||||
|
||||
# Create a bin directory with a wrapper script
|
||||
mkdir -p $out/bin
|
||||
cat > $out/bin/frontend <<EOF
|
||||
#!/bin/sh
|
||||
${pkgs.python3}/bin/python -m http.server --directory $out 8000
|
||||
EOF
|
||||
chmod +x $out/bin/frontend
|
||||
'';
|
||||
};
|
||||
in
|
||||
@ -36,6 +44,11 @@
|
||||
default = frontend;
|
||||
};
|
||||
|
||||
apps.default = {
|
||||
type = "app";
|
||||
program = "${frontend}/bin/frontend";
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.nodejs
|
||||
|
Loading…
x
Reference in New Issue
Block a user