Skip to content

Commit 3a11366

Browse files
committed
fix: src/data: fix #393 by extracting mdbook to own cell
1 parent eee0a7e commit 3a11366

File tree

6 files changed

+43
-30
lines changed

6 files changed

+43
-30
lines changed

dogfood.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ in
2121
}
2222
(std.grow {
2323
inherit inputs;
24-
cellsFrom = incl ./src ["std" "lib" "data"];
24+
cellsFrom = incl ./src ["std" "lib" "data" "mdbook"];
2525
cellBlocks = with std.blockTypes; [
2626
## For downstream use
2727

src/data/configs/mdbook.nix

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
1-
let
2-
inherit (inputs) nixpkgs;
3-
inherit (inputs.mdbook-paisano-preprocessor.app.package) mdbook-paisano-preprocessor;
4-
in {
5-
hook.mode = "copy"; # let CI pick it up outside of devshell
6-
packages = [
7-
nixpkgs.alejandra
8-
nixpkgs.nodePackages.prettier
9-
nixpkgs.nodePackages.prettier-plugin-toml
10-
nixpkgs.shfmt
11-
mdbook-paisano-preprocessor
12-
];
13-
14-
data = {
15-
book = {
16-
language = "en";
17-
multilingual = false;
18-
src = "docs";
19-
title = "Documentation";
20-
};
21-
build = {
22-
build-dir = "docs/book";
23-
};
24-
preprocessor.paisano-preprocessor = {
25-
before = ["links"];
26-
registry = ".#__std.init";
27-
};
28-
};
29-
}
1+
/*
2+
extracted out to separate cell to fix https://github.com/divnix/std/issues/393
3+
you can read the real source at /src/mdbook/configs/mdbook.nix
4+
*/
5+
inputs.cells.mdbook.configs.mdbook

src/mdbook/configs/default.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
let
2+
inherit (inputs) cells;
3+
inherit (inputs.std) findTargets;
4+
5+
inherit (inputs.nixpkgs.lib) recursiveUpdate mapAttrs;
6+
7+
data = findTargets {
8+
inherit inputs cell;
9+
block = ./.;
10+
};
11+
in
12+
mapAttrs (name: config: recursiveUpdate config (data.${name} or {})) cells.lib.cfg

src/mdbook/configs/mdbook.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
let
2+
inherit (inputs) nixpkgs;
3+
inherit (inputs.mdbook-paisano-preprocessor.app.package) mdbook-paisano-preprocessor;
4+
in {
5+
hook.mode = "copy"; # let CI pick it up outside of devshell
6+
packages = [
7+
mdbook-paisano-preprocessor
8+
];
9+
10+
data = {
11+
book = {
12+
language = "en";
13+
multilingual = false;
14+
src = "docs";
15+
title = "Documentation";
16+
};
17+
build = {
18+
build-dir = "docs/book";
19+
};
20+
preprocessor.paisano-preprocessor = {
21+
before = ["links"];
22+
registry = ".#__std.init";
23+
};
24+
};
25+
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)