2023-12-30 18:27:23 +00:00
|
|
|
{
|
|
|
|
description = "A site in nix?";
|
|
|
|
|
2023-12-31 21:33:42 +00:00
|
|
|
outputs = { self, nixpkgs, }:
|
|
|
|
let
|
|
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
nixite = import ./nixite/. { inherit pkgs; };
|
|
|
|
in nixite // {
|
2023-12-31 09:28:28 +00:00
|
|
|
packages.${system} = {
|
2023-12-31 21:33:42 +00:00
|
|
|
default = nixite.mkSite (nixite.site.applyStyle ./testing/src/style.css
|
2023-12-31 09:28:28 +00:00
|
|
|
(nixite.site.extractPaths {
|
2023-12-31 21:33:42 +00:00
|
|
|
"index.html" = with nixite.elems;
|
|
|
|
(Doc [
|
|
|
|
[
|
|
|
|
(title "Nixite")
|
|
|
|
(nixite.html.tag "link" {
|
|
|
|
rel = "shortcut icon";
|
|
|
|
type = "image/png";
|
|
|
|
href = ./testing/src/favicon.png;
|
|
|
|
} "")
|
|
|
|
]
|
|
|
|
(main [
|
|
|
|
(a "/blog" "blog")
|
|
|
|
(list [ "item 1" "item 2" "item 3" ])
|
2023-12-31 09:28:28 +00:00
|
|
|
])
|
2023-12-31 21:33:42 +00:00
|
|
|
]);
|
2023-12-31 10:33:05 +00:00
|
|
|
blog = nixite.md.readDir ./testing/blog;
|
2023-12-31 21:33:42 +00:00
|
|
|
}));
|
2023-12-31 00:48:19 +00:00
|
|
|
|
2023-12-31 17:51:21 +00:00
|
|
|
serve = nixite.serve self.packages.${system}.default;
|
2023-12-30 18:27:23 +00:00
|
|
|
|
2023-12-31 21:33:42 +00:00
|
|
|
test = let test = import ./testing/import.nix;
|
|
|
|
in pkgs.writeShellScriptBin "test" ''
|
|
|
|
${test ./testing/md.test.nix}
|
|
|
|
${test ./testing/html.test.nix}
|
|
|
|
${test ./testing/elems.test.nix}
|
|
|
|
${test ./testing/site.test.nix}
|
|
|
|
${test ./testing/style.test.nix}
|
|
|
|
'';
|
2023-12-31 09:28:28 +00:00
|
|
|
};
|
2023-12-30 18:27:23 +00:00
|
|
|
};
|
|
|
|
}
|