2024-06-30 15:58:29 +00:00
|
|
|
with import <nixpkgs> { };
|
2023-09-28 11:17:30 +00:00
|
|
|
|
|
|
|
let
|
2023-12-09 16:59:33 +00:00
|
|
|
inherit (builtins) stringLength readDir filter;
|
2024-06-30 15:58:29 +00:00
|
|
|
devices = filter (n: n != "families") (lib.mapAttrsToList (n: t: n) (readDir ../devices));
|
|
|
|
texts = map (
|
|
|
|
n:
|
|
|
|
let
|
|
|
|
d = import ../devices/${n}/default.nix;
|
2025-02-10 21:55:08 +00:00
|
|
|
tag = ".. _${lib.strings.replaceStrings [ " " ] [ "-" ] n}:";
|
2024-06-30 15:58:29 +00:00
|
|
|
d' = {
|
2024-07-10 22:36:24 +00:00
|
|
|
description = ''
|
|
|
|
${n}
|
2025-04-08 20:24:31 +00:00
|
|
|
${substring 0 (stringLength n) "============================"}
|
2024-07-10 22:36:24 +00:00
|
|
|
'';
|
2024-06-30 15:58:29 +00:00
|
|
|
} // d;
|
|
|
|
in
|
2025-02-10 21:55:08 +00:00
|
|
|
"${tag}\n\n${d'.description}"
|
2024-06-30 15:58:29 +00:00
|
|
|
) devices;
|
2023-09-28 11:17:30 +00:00
|
|
|
in
|
|
|
|
writeText "hwdoc" ''
|
|
|
|
${lib.concatStringsSep "\n\n" texts}
|
|
|
|
|
|
|
|
''
|