html.nix/flake.nix

34 lines
884 B
Nix
Raw Normal View History

2021-05-15 02:30:42 +03:00
{
outputs = { self }:
2021-05-15 02:30:42 +03:00
let
utils = import ./utils.nix;
2021-05-15 19:42:16 +03:00
lib = {
tags = import ./tags.nix { inherit utils; };
templaters = {
basic = import ./templaters/basic.nix;
};
};
pkgsLib = (final: prev: {
2021-05-15 19:42:16 +03:00
htmlNix = import ./pkgs-lib.nix { pkgs = prev; utils = utils // { inherit (lib) tags; }; };
});
2021-05-15 02:30:42 +03:00
in
{
2021-05-15 19:42:16 +03:00
inherit lib;
overlays = {
inherit pkgsLib;
};
2021-05-15 02:54:56 +03:00
examples = {
2021-05-15 19:42:16 +03:00
siteServe =
let inherit (import <nixpkgs> { overlays = [ pkgsLib ]; }) htmlNix; in
htmlNix.mkServeFromSite (htmlNix.mkSiteFrom { src = ./examples/site; templater = lib.templaters.basic; }); # needs --impure
tags = import ./examples/tags.nix lib.tags;
serve = import ./examples/serve.nix { inherit (lib) tags; inherit pkgsLib; }; # needs --impure
2021-05-15 02:54:56 +03:00
};
2021-05-15 02:30:42 +03:00
};
}