84 lines
No EOL
2.5 KiB
Nix
84 lines
No EOL
2.5 KiB
Nix
{
|
|
description = "cl-yag static site generator";
|
|
inputs = {
|
|
cl-nix-lite.url = "github:hraban/cl-nix-lite";
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
outputs = {
|
|
self, nixpkgs, cl-nix-lite, flake-utils
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system}.extend cl-nix-lite.overlays.default;
|
|
in
|
|
{
|
|
packages = {
|
|
ecl = with pkgs.lispPackagesLiteFor pkgs.ecl; lispDerivation {
|
|
name = "thoughts";
|
|
lispSystem = "thoughts";
|
|
lispDependencies = [
|
|
asdf
|
|
arrow-macros
|
|
];
|
|
src = pkgs.lib.cleanSource ./generator.lisp;
|
|
meta = {
|
|
license = pkgs.lib.licenses.agpl3Only;
|
|
};
|
|
|
|
buildInputs = [
|
|
pkgs.ecl
|
|
pkgs.git
|
|
pkgs.gnumake
|
|
pkgs.asdf
|
|
pkgs.multimarkdown
|
|
];
|
|
|
|
phases = [ "unpackPhase" "installPhase" "cleanupPhase" ];
|
|
|
|
unpackPhase = ''
|
|
mkdir -p $TMPDIR
|
|
cp ${./generator.lisp} $TMPDIR/generator.lisp
|
|
mkdir -p $TMPDIR/data
|
|
cp -r ${toString ./data}/* $TMPDIR/data/
|
|
mkdir -p $TMPDIR/templates
|
|
cp -r ${toString ./templates}/* $TMPDIR/templates/
|
|
mkdir -p $TMPDIR/static
|
|
cp -r ${toString ./static}/* $TMPDIR/static/
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/html
|
|
mkdir -p $out/gemini
|
|
mkdir -p $TMPDIR/output/gemini/articles
|
|
mkdir -p $TMPDIR/output/html
|
|
mkdir -p $TMPDIR/temp/data
|
|
cd $TMPDIR
|
|
ecl --load $TMPDIR/generator.lisp
|
|
cp -R $TMPDIR/static $out/html/
|
|
cp -r $TMPDIR/output/html/* $out/html/
|
|
cp -r $TMPDIR/output/gemini/* $out/gemini/
|
|
cp -r $TMPDIR $out/tmpdir
|
|
'';
|
|
|
|
cleanupPhase = ''
|
|
rm -rf $TMPDIR/temp
|
|
'';
|
|
};
|
|
};
|
|
|
|
devShell = pkgs.mkShell {
|
|
buildInputs = [
|
|
pkgs.ecl
|
|
pkgs.git
|
|
pkgs.gnumake
|
|
pkgs.asdf
|
|
pkgs.multimarkdown
|
|
];
|
|
shellHook = ''
|
|
echo "Welcome to the development shell for cl-yag static site generator!"
|
|
ecl --load generator.lisp
|
|
'';
|
|
};
|
|
});
|
|
} |