A web bundler for Nix strings with context.
Named after the flightless parrot.
Because I'm unwell and and think cursed hacks like //users/sterni/nix/html/README.md are cool and would like to make it's usage more practical.
- Writing a bundle from a derivation
let
indexHTML = writeText "index.html" ''
<h1>Welcome!</h1>
<img src="${./banner.jpg}" />
'';
webRoot = runCommand "webroot" { } ''
mkdir $out
cp ${indexHTML} $out/index.html
'';
in kakapo.makeBundle webRoot;
- Bundling a file tree from an attribute set
kakapo.bundleTree "my-webroot" { } {
"index.html" = ''
<h1>Welcome!</h1>
<img src="${./banner.jpg}" />
'';
}
Check out ./templates/htmlNix.