hardware.nix (753B)
1 with import <nixpkgs> {} ; 2 3 let 4 inherit (builtins) stringLength readDir filter; 5 devices = filter (n: n != "families") 6 (lib.mapAttrsToList (n: t: n) (readDir ../devices)); 7 texts = map (n: 8 let d = import ../devices/${n}/default.nix; 9 d' = { 10 description = "${n}\n${substring 0 (stringLength n) "********************************"}\n"; 11 } // d; 12 installer = 13 if d ? description && d ? installer 14 then '' 15 16 The default installation route for this device is 17 :ref:`system-outputs-${d.installer}` 18 '' 19 else ""; 20 in d'.description) 21 devices; 22 in 23 writeText "hwdoc" '' 24 Supported hardware 25 ################## 26 27 ${lib.concatStringsSep "\n\n" texts} 28 29 ''