refactor: move out large code blocks out of nix

This commit is contained in:
fufsob authored and FUFSoB committed 2026-10-04 11:54:04 +05:00
1 parent e8ace6523d
commit af5b3ff27a
47 files changed
+2220 -2070

No files matched your search

+1 -27
View File
@@ -136,33 +136,7 @@
pkgs.git
pkgs.nix
];
text = ''
set -euo pipefail
repo_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
if [[ -z "''${repo_root}" || ! -f "''${repo_root}/flake.nix" ]]; then
echo "run this helper from inside the proxy-suite-flake repository" >&2
exit 1
fi
options_output_path="$(nix build --no-link --print-out-paths "''${repo_root}#optionsDoc")"
readme_output_path="$(nix build --no-link --print-out-paths "''${repo_root}#readmeDoc")"
mkdir -p "''${repo_root}/docs"
rm -rf "''${repo_root}/docs/options"
cp -r --no-preserve=mode,ownership "''${options_output_path}" "''${repo_root}/docs/options"
install -Dm644 "''${readme_output_path}" "''${repo_root}/README.md"
# After the README, whose blocks are among them.
snippets_output_path="$(nix build --no-link --print-out-paths "''${repo_root}#usageSnippets")"
rm -rf "''${repo_root}/docs/usage/.snippets"
cp -r --no-preserve=mode,ownership "''${snippets_output_path}" "''${repo_root}/docs/usage/.snippets"
echo "updated ''${repo_root}/docs/options/"
echo "updated ''${repo_root}/README.md"
echo "updated ''${repo_root}/docs/usage/.snippets/"
'';
text = builtins.readFile ./nix/update-docs.sh;
};
in
{