2024-04-16 13:05:35 +00:00
|
|
|
{ self, ... }:
|
2024-01-17 07:13:09 +00:00
|
|
|
{
|
2024-04-16 13:05:35 +00:00
|
|
|
perSystem =
|
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
self',
|
|
|
|
inputs',
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
build =
|
|
|
|
baseUrl:
|
2024-05-17 14:56:43 +00:00
|
|
|
pkgs.runCommand "website" { buildInputs = [ ]; } ''
|
2024-04-16 13:05:35 +00:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r ${self}/* .
|
|
|
|
chmod -R u+w .
|
2024-01-17 07:13:09 +00:00
|
|
|
|
2024-04-16 13:05:35 +00:00
|
|
|
substituteInPlace config.toml --replace \
|
|
|
|
'base_url = "https://clan.lol"' \
|
|
|
|
'base_url = "${baseUrl}"' \
|
2024-01-17 07:13:09 +00:00
|
|
|
|
2024-05-17 14:56:43 +00:00
|
|
|
cp -r website/* website/.* $out
|
2024-05-21 15:00:58 +00:00
|
|
|
cp -r static/* static/.* $out
|
2024-04-16 13:05:35 +00:00
|
|
|
'';
|
|
|
|
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}
|
|
|
|
'';
|
|
|
|
};
|
2024-01-17 07:13:09 +00:00
|
|
|
}
|