Skip to content

Commit 0024d85

Browse files
committed
modules/docs: files -> user-guide
1 parent 63b9177 commit 0024d85

File tree

3 files changed

+35
-45
lines changed

3 files changed

+35
-45
lines changed

modules/docs/default.nix

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

1616
imports = [
1717
./_util.nix
18-
./files.nix
1918
./mdbook
2019
./menu
2120
./options.nix
2221
./pages.nix
2322
./platforms.nix
23+
./user-guide.nix
2424
];
2525

2626
config.docs = {

modules/docs/files.nix

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

modules/docs/user-guide.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
# TODO: contributing file
19+
docs.pages = lib.concatMapAttrs (
20+
name: type:
21+
let
22+
title = lib.removeSuffix ".md" name;
23+
transformer = sourceTransformers.${title} or lib.id;
24+
in
25+
lib.optionalAttrs (type == "regular") {
26+
"user-guide/${title}" = {
27+
menu.section = "user-guide";
28+
# TODO: define user-facing titles to show in the menu...
29+
menu.location = [ title ];
30+
source = transformer "${user-guide}/${name}";
31+
};
32+
}
33+
) (builtins.readDir user-guide);
34+
}

0 commit comments

Comments
 (0)