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
|
|
|
|
2022-07-30 12:42:09 +03:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
flakeUtils,
|
|
|
|
nixpkgs,
|
|
|
|
}: let
|
|
|
|
utils = import ./utils.nix;
|
2021-05-18 23:10:21 +03:00
|
|
|
|
2022-07-30 12:42:09 +03:00
|
|
|
lib = {
|
|
|
|
# Convert Nix expressions to HTML
|
|
|
|
tags = import ./tags.nix {inherit utils;};
|
|
|
|
# Convert Nix expressions to CSS
|
|
|
|
css = import ./css.nix {inherit utils;};
|
2021-05-18 23:10:21 +03:00
|
|
|
|
2022-07-30 12:42:09 +03:00
|
|
|
# Various site templaters
|
|
|
|
templaters = {
|
|
|
|
# Basic templater with purecss, mobile responsive layout and supports posts
|
|
|
|
basic = import ./templaters/basic.nix;
|
2021-05-18 23:10:21 +03:00
|
|
|
};
|
2022-07-30 12:42:09 +03:00
|
|
|
};
|
2021-05-18 23:10:21 +03:00
|
|
|
|
2022-07-30 12:42:09 +03:00
|
|
|
outputs = flakeUtils.lib.eachDefaultSystem (system: let
|
2022-07-30 13:50:49 +03:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2022-07-30 12:42:09 +03:00
|
|
|
in {
|
|
|
|
lib = {
|
|
|
|
pkgsLib = import ./pkgs-lib.nix {
|
|
|
|
inherit pkgs;
|
|
|
|
utils = utils // {inherit (lib) tags css;};
|
2021-05-16 00:43:38 +03:00
|
|
|
};
|
2022-07-30 12:42:09 +03:00
|
|
|
};
|
2021-05-15 22:23:14 +03:00
|
|
|
|
2022-07-30 12:42:09 +03:00
|
|
|
apps = with flakeUtils.lib; {
|
|
|
|
site = mkApp {
|
|
|
|
drv = import ./examples/site.nix {inherit lib pkgs;};
|
|
|
|
name = "serve";
|
|
|
|
};
|
|
|
|
basicServe = mkApp {
|
|
|
|
drv = import ./examples/serve.nix {
|
|
|
|
inherit (lib) tags;
|
|
|
|
inherit pkgs;
|
2021-05-15 22:23:14 +03:00
|
|
|
};
|
2022-07-30 12:42:09 +03:00
|
|
|
name = "serve";
|
2021-05-15 19:42:16 +03:00
|
|
|
};
|
2022-07-30 12:42:09 +03:00
|
|
|
};
|
2021-05-15 19:42:16 +03:00
|
|
|
|
2022-07-30 12:42:09 +03:00
|
|
|
examples = {
|
|
|
|
tags = import ./examples/tags.nix lib.tags;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
outputs // {lib = outputs.lib // lib;};
|
2021-05-15 02:30:42 +03:00
|
|
|
}
|