liminix/doc/hardware.nix

29 lines
714 B
Nix
Raw Normal View History

with import <nixpkgs> {} ;
let
2023-11-10 22:17:20 +01:00
devices = builtins.readDir ../devices;
inherit (builtins) stringLength;
texts = lib.mapAttrsToList (n: t:
let d = import ../devices/${n}/default.nix;
d' = {
2023-11-10 22:17:20 +01:00
description = "${n}\n${substring 0 (stringLength n) "********************************"}\n";
} // d;
installer =
2023-11-10 22:17:20 +01:00
if d ? description && d ? installer
then ''
The default installation route for this device is
:ref:`system-outputs-${d.installer}`
''
else "";
in (d'.description + installer))
devices;
in
writeText "hwdoc" ''
Supported hardware
##################
${lib.concatStringsSep "\n\n" texts}
''