Skip to content

Commit 7b1b93e

Browse files
committed
Document how to build/test/run docs w/Makefile
- Also update `poetry.lock` to new lock-file format for poetry - Update poetry/mkdocs dependencies - Update nixpkgs flake input and make `flake.nix` smaller =)
1 parent 85cdb33 commit 7b1b93e

File tree

4 files changed

+216
-250
lines changed

4 files changed

+216
-250
lines changed

Makefile

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
.PHONY: all install local
2-
SHELL := bash
1+
.PHONY: build check serve install-mkdocs
32

4-
all: install local
5-
6-
install:
3+
install-mkdocs:
74
poetry install
85

9-
local:
10-
poetry run mkdocs serve --dev-addr localhost:8001
6+
build:
7+
poetry run mkdocs build --strict
8+
9+
chect: build
10+
11+
serve:
12+
poetry run mkdocs serve --clean --strict --watch docs/

flake.lock

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+16-26
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,27 @@
11
{
22
description = "dev env for handbook";
33

4-
# Flake inputs
5-
inputs = {
6-
nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs"
7-
};
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
5+
inputs.flake-utils.url = "github:numtide/flake-utils";
86

9-
# Flake outputs
10-
outputs = { self, nixpkgs }:
11-
let
7+
outputs =
8+
inputs:
9+
inputs.flake-utils.lib.eachSystem
1210
# Systems supported
13-
allSystems = [
14-
"x86_64-linux" # 64-bit Intel/AMD Linux
15-
"aarch64-linux" # 64-bit ARM Linux
16-
"x86_64-darwin" # 64-bit Intel macOS
17-
"aarch64-darwin" # 64-bit ARM macOS
18-
];
19-
20-
# Helper to provide system-specific attributes
21-
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
22-
pkgs = import nixpkgs { inherit system; };
23-
});
24-
in
25-
{
26-
# Development environment output
27-
devShells = forAllSystems ({ pkgs }: {
28-
default =
29-
pkgs.mkShell {
11+
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]
12+
(
13+
system:
14+
let
15+
pkgs = import inputs.nixpkgs { localSystem = { inherit system; }; };
16+
in
17+
{
18+
devShells.default = pkgs.mkShell {
3019
packages = with pkgs; [
20+
# Development environment output
3121
python311
3222
poetry
3323
];
3424
};
35-
});
36-
};
25+
}
26+
);
3727
}

0 commit comments

Comments
 (0)