Created
May 9, 2016 23:52
-
-
Save tokudan/ff3d11cac2ebe8318e24be76a6d87343 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/run/current-system/sw/bin/gawk -f | |
| function enumerate(option, cmd, value, o) { | |
| cmd = "nixos-option " option " 2>/dev/null" | |
| #print cmd | |
| value = "" | |
| while(cmd | getline && (value == "")) { | |
| if($0 == "Value:") { | |
| cmd | getline value | |
| print option " = " substr(value, 1, 50) | |
| } else { | |
| o = option "." $1 | |
| #print o | |
| enumerate(o) | |
| } | |
| } | |
| close(cmd) | |
| } | |
| BEGIN { | |
| while("nixos-option 2>/dev/null" | getline) { | |
| option = $1 | |
| #print option | |
| enumerate(option) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment