mirror of
https://github.com/srid/haskell-flake.git
synced 2024-10-03 17:48:06 +03:00
Nixify rundoc.sh
This commit is contained in:
parent
11b457aefc
commit
d066315e0a
@ -27,6 +27,11 @@
|
||||
packages = with pkgs; [
|
||||
just
|
||||
];
|
||||
shellHook = ''
|
||||
echo
|
||||
echo "🍎🍎 Run 'just <recipe>' to get started"
|
||||
just
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -37,6 +37,22 @@
|
||||
};
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
checks.linkcheck = inputs'.flake-parts-website.checks.linkcheck;
|
||||
packages.flake-parts = inputs'.flake-parts-website.packages.default;
|
||||
apps.flake-parts.program = pkgs.writeShellApplication {
|
||||
name = "docs-flake-parts";
|
||||
meta.description = "Open flake.parts docs, previewing local haskell-flake version";
|
||||
text = ''
|
||||
DOCSHTML="${self'.packages.flake-parts}/options/haskell-flake.html"
|
||||
|
||||
if [ "$(uname)" == "Darwin" ]; then
|
||||
open $DOCSHTML
|
||||
else
|
||||
if type xdg-open &>/dev/null; then
|
||||
xdg-open $DOCSHTML
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -30,6 +30,8 @@
|
||||
dir = "doc";
|
||||
overrideInputs = {
|
||||
"haskell-flake" = ./.;
|
||||
# TODO: It is better to add a update-flake-lock.yaml CI action to
|
||||
# update this just like ./example inputs.
|
||||
"flake-parts-website" = "github:hercules-ci/flake.parts-website";
|
||||
};
|
||||
};
|
||||
|
8
justfile
8
justfile
@ -12,3 +12,11 @@ check:
|
||||
# Auto-format the Nix files in project tree
|
||||
fmt:
|
||||
treefmt
|
||||
|
||||
# Open haskell-flake docs live preview
|
||||
docs:
|
||||
cd ./doc && nix run
|
||||
|
||||
# Open flake.parts docs, previewing local haskell-flake version
|
||||
docs-flake-parts:
|
||||
cd ./doc && nix run .#flake-parts
|
||||
|
29
rundoc.sh
29
rundoc.sh
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# TODO: Move this dev/flake.nix as flake app
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
nix run github:srid/emanote -- -L ./doc
|
||||
else
|
||||
# Renders the docs, prints the location of the docs, opens the docs if possible
|
||||
#
|
||||
# Does not run the link checker. That's done in nixci checks.
|
||||
nix --option sandbox false \
|
||||
build ${OVERRIDE_HASKELL_FLAKE} \
|
||||
-L --show-trace \
|
||||
github:hercules-ci/flake.parts-website \
|
||||
"$@"
|
||||
|
||||
DOCSHTML="$PWD/result/options/haskell-flake.html"
|
||||
|
||||
echo "Docs rendered to $DOCSHTML"
|
||||
|
||||
if [ "$(uname)" == "Darwin" ]; then
|
||||
open $DOCSHTML
|
||||
else
|
||||
if type xdg-open &>/dev/null; then
|
||||
xdg-open $DOCSHTML
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
Loading…
Reference in New Issue
Block a user