fixed imports and added scripts
This commit is contained in:
24
scripts/inspect.sh
Executable file
24
scripts/inspect.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
NIX_EVAL_CMD="nix eval --json --no-warn-dirty --apply builtins.attrNames"
|
||||
|
||||
list_flake_attr() {
|
||||
attr="$1"
|
||||
flake="${2:-.}"
|
||||
echo "${attr} [${flake}]:"
|
||||
$NIX_EVAL_CMD "${flake}#${attr}" | jq -r '" - " + .[]'
|
||||
echo
|
||||
}
|
||||
|
||||
list_home_modules() {
|
||||
list_flake_attr "homeModules" "$1"
|
||||
}
|
||||
|
||||
list_home_configurations() {
|
||||
list_flake_attr "homeConfigurations" "$1"
|
||||
}
|
||||
|
||||
current_dir=$(readlink -f .)
|
||||
flake="${1:-$current_dir}"
|
||||
list_home_modules "$flake"
|
||||
list_home_configurations "$flake"
|
||||
Reference in New Issue
Block a user