2023-01-15 23:34:52 +03:00
|
|
|
{ lib, nixosOptionsDoc, runCommand, fetchurl, pandoc }:
|
|
|
|
|
|
|
|
let
|
2023-05-16 14:40:03 +03:00
|
|
|
diskoLib = import ./lib {
|
2023-01-24 17:57:17 +03:00
|
|
|
inherit lib;
|
|
|
|
rootMountPoint = "/mnt";
|
|
|
|
};
|
2023-01-15 23:34:52 +03:00
|
|
|
eval = lib.evalModules {
|
2023-02-06 17:24:34 +03:00
|
|
|
modules = [
|
2023-01-15 23:34:52 +03:00
|
|
|
{
|
|
|
|
options.disko = {
|
|
|
|
devices = lib.mkOption {
|
2023-07-13 16:08:20 +03:00
|
|
|
type = diskoLib.toplevel;
|
2023-02-06 17:24:34 +03:00
|
|
|
default = { };
|
2023-01-15 23:34:52 +03:00
|
|
|
description = "The devices to set up";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
options = nixosOptionsDoc {
|
2023-02-07 18:37:12 +03:00
|
|
|
options = eval.options;
|
2023-01-15 23:34:52 +03:00
|
|
|
};
|
|
|
|
md = (runCommand "disko-options.md" { } ''
|
|
|
|
cat >$out <<EOF
|
|
|
|
# Disko options
|
|
|
|
|
|
|
|
EOF
|
|
|
|
cat ${options.optionsCommonMark} >>$out
|
2023-06-06 14:32:47 +03:00
|
|
|
'').overrideAttrs (_o: {
|
2023-02-06 17:24:34 +03:00
|
|
|
# Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168
|
|
|
|
allowSubstitutes = true;
|
2023-01-15 23:34:52 +03:00
|
|
|
});
|
|
|
|
css = fetchurl {
|
|
|
|
url = "https://gist.githubusercontent.com/killercup/5917178/raw/40840de5352083adb2693dc742e9f75dbb18650f/pandoc.css";
|
|
|
|
sha256 = "sha256-SzSvxBIrylxBF6B/mOImLlZ+GvCfpWNLzGFViLyOeTk=";
|
|
|
|
};
|
2023-02-06 17:24:34 +03:00
|
|
|
in
|
|
|
|
runCommand "disko.html" { nativeBuildInputs = [ pandoc ]; } ''
|
2023-01-15 23:34:52 +03:00
|
|
|
mkdir $out
|
|
|
|
cp ${css} $out/pandoc.css
|
|
|
|
pandoc --css="pandoc.css" ${md} --to=html5 -s -f markdown+smart --metadata pagetitle="Disko options" -o $out/index.html
|
|
|
|
''
|