my over complex system configurations dotfiles.isabelroses.com/
nixos nix flake dotfiles linux
at main 65 lines 1.0 kB view raw
1{ 2 stdenvNoCC, 3 lib, 4 nixdoc, 5 6 inputs, 7 self ? inputs.self, 8 9 libset ? [ 10 { 11 name = "hardware"; 12 description = "deterministic hardware"; 13 } 14 { 15 name = "helpers"; 16 description = "helpers"; 17 } 18 { 19 name = "secrets"; 20 description = "secrets"; 21 } 22 { 23 name = "services"; 24 description = "services"; 25 } 26 { 27 name = "validators"; 28 description = "validators"; 29 } 30 ], 31}: 32stdenvNoCC.mkDerivation { 33 name = "lib-docs"; 34 35 src = self + /modules/flake/lib; 36 37 nativeBuildInputs = [ 38 nixdoc 39 ]; 40 41 installPhase = '' 42 runHook preInstall 43 44 mkdir -p "$out" 45 46 function docgen { 47 name=$1 48 description=$3 49 nixdoc -c "$name" -d "lib.$name: $description" -f "$name.nix" > "$out/$name.md" 50 echo "- [$name](lib/$name.md)" >> "$out/index.md" 51 } 52 53 ${lib.concatMapStrings ( 54 { 55 name, 56 description, 57 }: 58 '' 59 docgen ${name} ${lib.escapeShellArg description} 60 '' 61 ) libset} 62 63 runHook postInstall 64 ''; 65}