doc: add some devshell helpers
Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
parent
1b62b19f21
commit
1e6a0ad963
26
nix/docs.nix
26
nix/docs.nix
|
@ -1,5 +1,9 @@
|
|||
_: {
|
||||
perSystem = {pkgs, self', ...}: {
|
||||
perSystem = {
|
||||
pkgs,
|
||||
self',
|
||||
...
|
||||
}: {
|
||||
packages.docs = pkgs.buildNpmPackage {
|
||||
pname = "treefmt-docs";
|
||||
inherit (self'.packages.default) version;
|
||||
|
@ -17,12 +21,30 @@ _: {
|
|||
};
|
||||
|
||||
devshells.default = {
|
||||
packages = [
|
||||
pkgs.nodejs
|
||||
];
|
||||
|
||||
commands = let
|
||||
category = "docs";
|
||||
in [
|
||||
{
|
||||
inherit category;
|
||||
package = pkgs.nodejs;
|
||||
name = "docs:dev";
|
||||
help = "serve docs for local development";
|
||||
command = "cd $PRJ_ROOT/docs && npm run docs:dev";
|
||||
}
|
||||
{
|
||||
inherit category;
|
||||
name = "docs:build";
|
||||
help = "create a production build of docs";
|
||||
command = "cd $PRJ_ROOT/docs && npm run docs:build";
|
||||
}
|
||||
{
|
||||
inherit category;
|
||||
name = "docs:preview";
|
||||
help = "preview a production build of docs";
|
||||
command = "cd $PRJ_ROOT/docs && npm run docs:preview";
|
||||
}
|
||||
{
|
||||
inherit category;
|
||||
|
|
Reference in New Issue
Block a user