Skip to content

Commit d066315

Browse files
committed
Nixify rundoc.sh
1 parent 11b457a commit d066315

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

dev/flake.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
packages = with pkgs; [
2828
just
2929
];
30+
shellHook = ''
31+
echo
32+
echo "🍎🍎 Run 'just <recipe>' to get started"
33+
just
34+
'';
3035
};
3136
};
3237
};

doc/flake.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@
3737
};
3838
formatter = pkgs.nixpkgs-fmt;
3939
checks.linkcheck = inputs'.flake-parts-website.checks.linkcheck;
40+
packages.flake-parts = inputs'.flake-parts-website.packages.default;
41+
apps.flake-parts.program = pkgs.writeShellApplication {
42+
name = "docs-flake-parts";
43+
meta.description = "Open flake.parts docs, previewing local haskell-flake version";
44+
text = ''
45+
DOCSHTML="${self'.packages.flake-parts}/options/haskell-flake.html"
46+
47+
if [ "$(uname)" == "Darwin" ]; then
48+
open $DOCSHTML
49+
else
50+
if type xdg-open &>/dev/null; then
51+
xdg-open $DOCSHTML
52+
fi
53+
fi
54+
'';
55+
};
4056
};
4157
};
4258
}

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
dir = "doc";
3131
overrideInputs = {
3232
"haskell-flake" = ./.;
33+
# TODO: It is better to add a update-flake-lock.yaml CI action to
34+
# update this just like ./example inputs.
3335
"flake-parts-website" = "github:hercules-ci/flake.parts-website";
3436
};
3537
};

justfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ check:
1212
# Auto-format the Nix files in project tree
1313
fmt:
1414
treefmt
15+
16+
# Open haskell-flake docs live preview
17+
docs:
18+
cd ./doc && nix run
19+
20+
# Open flake.parts docs, previewing local haskell-flake version
21+
docs-flake-parts:
22+
cd ./doc && nix run .#flake-parts

rundoc.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)