Use the new `perSystem.stylix.aliases` option to rename `packages.«system».docs` and `apps.«system».docs` to `doc`. The alias will be defined until 25.11 and will always warn when evaluated.
22 lines
358 B
Nix
22 lines
358 B
Nix
{
|
|
doc,
|
|
http-server,
|
|
writeShellApplication,
|
|
}:
|
|
writeShellApplication {
|
|
name = "serve-docs";
|
|
runtimeInputs = [ http-server ];
|
|
runtimeEnv.server_flags = [
|
|
# Search for available port
|
|
"--port=0"
|
|
|
|
# Disable browser cache
|
|
"-c-1"
|
|
|
|
# Open using xdg-open
|
|
"-o"
|
|
];
|
|
text = ''
|
|
http-server ${doc} "''${server_flags[@]}"
|
|
'';
|
|
}
|