Files
liminix/doc/hardware.nix
2025-09-18 21:58:26 +01:00

24 lines
515 B
Nix

with import <nixpkgs> { };
let
inherit (builtins) stringLength readDir filter;
devices = filter (n: n != "families") (lib.mapAttrsToList (n: t: n) (readDir ../devices));
texts = map (
n:
let
d = import ../devices/${n}/default.nix;
tag = ".. _${lib.strings.replaceStrings [ " " ] [ "-" ] n}:";
d' = {
description = ''
== ${n}
'';
} // d;
in
"\n${d'.description}"
) devices;
in
writeText "hwdoc" ''
${lib.concatStringsSep "\n\n" texts}
''