Flake for my NixOS devices
at main 12 lines 432 B view raw
1{|cmd_name| 2 try { 3 let attrs = (nix-locate --minimal --no-group --type x --type s --whole-name --at-root $"/bin/($cmd_name)") 4 let len = (echo $attrs | split row "\n" | length) 5 6 if $len == 0 { 7 return null 8 } else { 9 return $"\nThe program ($cmd_name) is not installed, but available from the following location\(s\):\n\n($attrs | str replace ".out" "")" 10 } 11 } 12}