mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
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.
19 lines
337 B
Nix
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}
|
|
''
|