2021-05-15 02:30:42 +03:00
|
|
|
{
|
2021-05-15 22:23:14 +03:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
flakeUtils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
2021-05-15 04:02:06 +03:00
|
|
|
|
2021-05-15 22:23:14 +03:00
|
|
|
outputs = { self, flakeUtils, nixpkgs }:
|
|
|
|
flakeUtils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
utils = import ./utils.nix;
|
2021-05-15 19:42:16 +03:00
|
|
|
|
2021-05-15 22:23:14 +03:00
|
|
|
lib = {
|
|
|
|
tags = import ./tags.nix { inherit utils; };
|
|
|
|
|
|
|
|
templaters = {
|
|
|
|
basic = import ./templaters/basic.nix;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
pkgsLib = (final: prev: {
|
|
|
|
htmlNix = import ./pkgs-lib.nix { pkgs = prev; utils = utils // { inherit (lib) tags; }; };
|
|
|
|
});
|
|
|
|
|
|
|
|
pkgs = import nixpkgs { inherit system; overlays = [ pkgsLib ]; };
|
|
|
|
in
|
|
|
|
{
|
2021-05-16 00:43:38 +03:00
|
|
|
lib = lib // {
|
|
|
|
pkgsLib = import ./pkgs-lib.nix { inherit pkgs; utils = utils // { inherit (lib) tags; }; };
|
|
|
|
};
|
2021-05-15 22:23:14 +03:00
|
|
|
|
|
|
|
overlays = {
|
|
|
|
inherit pkgsLib;
|
|
|
|
};
|
|
|
|
|
|
|
|
apps = with flakeUtils.lib; {
|
|
|
|
site = mkApp {
|
|
|
|
drv = let inherit (pkgs) htmlNix; in
|
|
|
|
htmlNix.mkServeFromSite (htmlNix.mkSiteFrom { src = ./examples/site; templater = lib.templaters.basic; });
|
|
|
|
name = "serve";
|
|
|
|
};
|
|
|
|
basicServe = mkApp {
|
|
|
|
drv = import ./examples/serve.nix { inherit (lib) tags; inherit pkgs; };
|
|
|
|
name = "serve";
|
|
|
|
};
|
2021-05-15 19:42:16 +03:00
|
|
|
};
|
|
|
|
|
2021-05-15 22:23:14 +03:00
|
|
|
examples = {
|
|
|
|
tags = import ./examples/tags.nix lib.tags;
|
|
|
|
};
|
2021-05-15 04:02:06 +03:00
|
|
|
});
|
2021-05-15 02:30:42 +03:00
|
|
|
}
|