11.stylix/doc/server.nix
Matt Sturgeon 47553c06fb
flake: rename packages.«system».docspackages.«system».doc
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.
2025-06-04 16:10:53 +01:00

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[@]}"
'';
}