html.nix/flake.nix

58 lines
1.3 KiB
Nix
Raw Normal View History

2021-05-15 02:30:42 +03:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flakeUtils.url = "github:numtide/flake-utils";
};
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;};
};
2022-07-30 12:42:09 +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;
};
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
}