nix-community.nixvim/docs/server/default.nix
Matt Sturgeon f3342bdbd4
docs: refactor serve-docs; add nix run .#docs
Refactor `serve-docs` using `makeWrapper`, make it available as a
`serve-docs` package and as the `docs` "app".

This means `nix build .#docs` will build the docs while `nix run .#docs`
will run the server.
2025-05-22 13:48:58 +01:00

19 lines
337 B
Nix

{
lib,
runCommand,
makeBinaryWrapper,
python3,
docs,
}:
runCommand "serve-docs"
{
nativeBuildInputs = [ makeBinaryWrapper ];
meta.mainProgram = "server";
}
''
mkdir -p $out/bin
makeWrapper ${lib.getExe python3} \
$out/bin/server \
--add-flags ${./server.py} \
--chdir ${docs}
''