mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-12-26 14:14:58 +08:00
30 lines
1.1 KiB
Nix
30 lines
1.1 KiB
Nix
{ nixosOptionsDoc, runCommand, fetchurl, pandoc, nixos, sops-nix-flake ? null }:
|
|
|
|
let
|
|
eval = nixos [ ./modules/sops/default.nix ];
|
|
options = nixosOptionsDoc {
|
|
options = eval.options.sops;
|
|
};
|
|
rev = if sops-nix-flake != null then sops-nix-flake.rev or "master" else "master";
|
|
|
|
md = (runCommand "options.md" { } ''
|
|
cat >$out <<EOF
|
|
# Sops-nix options
|
|
|
|
EOF
|
|
cat ${options.optionsCommonMark} >>$out
|
|
sed -i -e 's!\[/nix/store/.*/modules/sops/\(.*\).*!' "$out"
|
|
'').overrideAttrs (_o: {
|
|
# Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168
|
|
allowSubstitutes = true;
|
|
});
|
|
css = fetchurl {
|
|
url = "https://gist.githubusercontent.com/killercup/5917178/raw/40840de5352083adb2693dc742e9f75dbb18650f/pandoc.css";
|
|
sha256 = "sha256-SzSvxBIrylxBF6B/mOImLlZ+GvCfpWNLzGFViLyOeTk=";
|
|
};
|
|
in
|
|
runCommand "sops.html" { nativeBuildInputs = [ pandoc ]; } ''
|
|
mkdir $out
|
|
cp ${css} $out/pandoc.css
|
|
pandoc --css="pandoc.css" ${md} --to=html5 -s -f markdown+smart --metadata pagetitle="Sops options" -o $out/index.html
|
|
''
|