Skip to content

Commit a68c703

Browse files
committed
fix + move docs/files -> docs/user-guide
1 parent 7bf8b88 commit a68c703

File tree

3 files changed

+34
-45
lines changed

3 files changed

+34
-45
lines changed

modules/docs/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ in
1212

1313
imports = [
1414
./_util.nix
15-
./files.nix
1615
./mdbook
1716
./menu
1817
./options.nix
1918
./pages.nix
2019
./platforms.nix
20+
./user-guide.nix
2121
];
2222

2323
config.docs = {

modules/docs/files.nix

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

modules/docs/user-guide.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
lib,
3+
pkgs,
4+
...
5+
}:
6+
let
7+
user-guide = ../../docs/user-guide;
8+
9+
sourceTransformers = {
10+
config-examples =
11+
template:
12+
pkgs.callPackage ./user-configs.nix {
13+
inherit template;
14+
};
15+
};
16+
in
17+
{
18+
docs.pages = lib.concatMapAttrs (
19+
name: type:
20+
let
21+
title = lib.removeSuffix ".md" name;
22+
transformer = sourceTransformers.${title} or lib.id;
23+
in
24+
lib.optionalAttrs (type == "regular") {
25+
"user-guide/${title}" = {
26+
menu.section = "user-guide";
27+
# TODO: define user-facing titles to show in the menu...
28+
menu.location = [ title ];
29+
source = transformer "${user-guide}/${name}";
30+
};
31+
}
32+
) (builtins.readDir user-guide);
33+
}

0 commit comments

Comments
 (0)