clan-homepage/flake-parts/website.nix
Qubasa 0c302009b6
All checks were successful
buildbot/nix-eval Build done.
check / test (push) Successful in 14s
deploy / test (push) Successful in 14s
Fix incorrect static path
2024-05-22 23:05:54 +02:00

35 lines
826 B
Nix

{ self, ... }:
{
perSystem =
{
lib,
pkgs,
self',
inputs',
...
}:
let
build =
baseUrl:
pkgs.runCommand "website" { buildInputs = [ ]; } ''
mkdir -p $out
cp -r ${self}/* .
chmod -R u+w .
cp -r website/* website/.* $out
rm $out/static
cp -r static/ $out/static
'';
in
{
packages.default = self'.packages.website;
packages.website = build "https://clan.lol";
packages.website-localhost = build "http://localhost:1111";
packages.serve = pkgs.writeShellScriptBin "serve-local" ''
echo "serving: ${self'.packages.website-localhost}"
${pkgs.python3}/bin/python -m http.server 1111 \
-d ${self'.packages.website-localhost}
'';
};
}