nixite/flake.nix

53 lines
1.3 KiB
Nix

{
description = "A site in nix?";
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
nixite = import ./nixite/. {inherit pkgs;};
in
nixite
// {
packages.${system} = {
default = nixite.mkSite (
nixite.site.applyStyle ./testing/src/style.css
(nixite.site.extractPaths {
"index.html" = with nixite.elems; (doc [
[
(title "Nixite")
(nixite.html.tag "link" {rel = "shortcut icon"; type = "image/png"; href = ./testing/src/favicon.png;} "")
]
(main [
(link "/blog" "blog")
(list [
"item 1"
"item 2"
"item 3"
])
])
]);
blog = nixite.md.readDir ./testing/blog;
})
);
serve = nixite.serve self.packages.${system}.default;
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}
'';
};
};
}