77 lines
2.1 KiB
Nix
77 lines
2.1 KiB
Nix
{
|
|
description = "A site in nix?";
|
|
|
|
inputs = {tix.url = "git+https://git.tristans.cloud/tristan/tix";};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
tix,
|
|
}: let
|
|
system = "x86_64-linux";
|
|
pkgs = import nixpkgs {inherit system;};
|
|
nixite = import ./nixite/. {inherit pkgs;};
|
|
in
|
|
nixite
|
|
// {
|
|
formatter.${system} = pkgs.alejandra;
|
|
packages.${system} = {
|
|
raw = nixite.mkSite (let
|
|
readme = {
|
|
name = "readme";
|
|
content = nixite.md.mdToPage ./README.md;
|
|
};
|
|
markup = {
|
|
"index.html" = with nixite.elems; let
|
|
blue = nixite.style.component span "blue" {
|
|
style = {color = "blue";};
|
|
};
|
|
underblue = nixite.style.component blue "under" {
|
|
style = {text-decoration = "underline";};
|
|
};
|
|
in (
|
|
nixite.html.document {
|
|
head = [(title "Nixite")];
|
|
body = main [
|
|
(a {href = nixite.site.link readme;} "Readme")
|
|
(a "/blog" "blog")
|
|
(List {} ["item 1" "item 2" "item 3"])
|
|
(p [
|
|
"check out my"
|
|
(blue "blue span")
|
|
"isn't it"
|
|
(underblue {onclick = "alert(1)";} "great!")
|
|
])
|
|
];
|
|
}
|
|
);
|
|
blog = nixite.md.readDir ./testing/blog;
|
|
};
|
|
site =
|
|
nixite.site.prepare {favicon = ./testing/src/favicon.png;}
|
|
markup;
|
|
in
|
|
site);
|
|
|
|
default = nixite.serve self.packages.${system}.raw;
|
|
|
|
test = tix.run [
|
|
./testing/md.test.nix
|
|
./testing/html.test.nix
|
|
./testing/elems.test.nix
|
|
./testing/site.test.nix
|
|
./testing/style.test.nix
|
|
];
|
|
|
|
watch = tix.packages.${system}.watch;
|
|
watchpipe = tix.packages.${system}.watchpipe;
|
|
results = tix.packages.${system}.results;
|
|
|
|
dev = tix.watch {
|
|
cmd = "nix run .# --show-trace";
|
|
stop = "pkill caddy";
|
|
};
|
|
};
|
|
};
|
|
}
|