2022-11-27 21:55:46 +01:00
|
|
|
{
|
2023-09-08 13:43:04 +02:00
|
|
|
description = "an container for mdbook with various plugins";
|
2022-11-27 21:55:46 +01:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
2022-12-03 15:24:15 +01:00
|
|
|
let inherit (flake-utils.lib) eachSystem system;
|
|
|
|
in eachSystem [ system.x86_64-linux ] (system:
|
2022-11-27 21:55:46 +01:00
|
|
|
let pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in {
|
|
|
|
packages = rec {
|
2023-09-08 13:43:04 +02:00
|
|
|
default = container;
|
2022-12-06 07:55:25 +01:00
|
|
|
container = pkgs.dockerTools.buildLayeredImage {
|
2022-12-03 17:04:48 +01:00
|
|
|
name = "mdbook-container";
|
2023-09-08 13:43:04 +02:00
|
|
|
tag = "0.4.0";
|
2022-12-03 15:19:25 +01:00
|
|
|
contents = [
|
|
|
|
(pkgs.buildEnv {
|
|
|
|
name = "mdbook-env";
|
2023-09-08 13:43:04 +02:00
|
|
|
paths = with pkgs; [ busybox mdbook mdbook-toc mdbook-katex ];
|
2022-12-03 15:19:25 +01:00
|
|
|
})
|
|
|
|
];
|
2022-11-27 21:55:46 +01:00
|
|
|
config.Cmd = [ "${pkgs.mdbook}/bin/mdbook" ];
|
|
|
|
};
|
|
|
|
mdbook-toc = pkgs.rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "mdbook-toc";
|
2023-09-08 13:43:04 +02:00
|
|
|
version = "0.14.1";
|
2022-11-27 21:55:46 +01:00
|
|
|
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "badboy";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-09-08 13:43:04 +02:00
|
|
|
sha256 = "sha256-F0dIqtDEOVUXlWhmXKPOaJTEuA3Tl3h0vaEu7VsBo7s=";
|
2022-11-27 21:55:46 +01:00
|
|
|
};
|
|
|
|
|
2023-09-08 13:43:04 +02:00
|
|
|
cargoSha256 = "sha256-gbBX6Hj+271BA9FWmkZdyR0tMP2Lny7UgW0o+kZe9bU=";
|
2022-11-27 21:55:46 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|