mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-09-11 08:35:24 +03:00
13 lines
366 B
Bash
Executable File
13 lines
366 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -efu
|
|
|
|
declare file attribute
|
|
eval "$(jq -r '@sh "attribute=\(.attribute) file=\(.file)"')"
|
|
if [[ -n ${file-} ]] && [[ -e ${file-} ]]; then
|
|
out=$(nix build --no-link --json -f "$file" "$attribute")
|
|
printf '%s' "$out" | jq -c '.[].outputs'
|
|
else
|
|
out=$(nix build --no-link --json "$attribute")
|
|
printf '%s' "$out" | jq -c '.[].outputs'
|
|
fi
|