Skip to content

Commit 583681d

Browse files
committed
feat(docs): improve docs package
- use `src` instead of `unpackPhase`, this was a hangover from some previous logic - execute usage generation hook against `treefmt` build instead of using `nix run`, as this would require recursive nix the build and is just more appropriate to use the built `treefmt` Signed-off-by: Brian McGee <[email protected]>
1 parent 90608c0 commit 583681d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/hooks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
def on_pre_build(**kwargs):
55
with Path("./snippets/usage.txt").open("w") as f:
66
subprocess.run(
7-
["nix", "run", ".#treefmt", "--", "--help"],
7+
["treefmt", "--help"],
88
stdout=f,
99
check=True,
1010
)

nix/packages/docs.nix

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
pkgs.stdenvNoCC.mkDerivation {
77
name = "docs";
88

9-
unpackPhase = ''
10-
cp -r ${../../docs}/* .
11-
ls -alr
12-
'';
9+
src = ../../.;
1310

1411
nativeBuildInputs =
15-
(with pkgs.python3Packages; [
12+
[
13+
perSystem.self.treefmt
14+
]
15+
++ (with pkgs.python3Packages; [
1616
mike
1717
mkdocs
1818
mkdocs-material
@@ -33,6 +33,7 @@ pkgs.stdenvNoCC.mkDerivation {
3333
];
3434

3535
buildPhase = ''
36+
cd docs
3637
mkdocs build
3738
'';
3839

0 commit comments

Comments
 (0)