4 IS_DARWIN
="@is_darwin@"
40 nix-info - get high level info to help with debugging
44 -m, --markdown formatting for a GitHub issue
45 implies: --host-os, --sandbox
47 --sandbox include sandbox configuration
48 --host-os include host OS details
50 -h, --help show this message
51 -d, --debug debug mode
61 if [ $DEBUG -eq 1 ]; then
69 nix-instantiate
--eval --strict -E "$1"
73 nixev
'(import <nixpkgs> {}).stdenv.hostPlatform.system'
77 printf "%s" "$(uname -sr)"
79 if [ "$IS_DARWIN" = "yes" ]; then
80 printf ", macOS %s" "$(sw_vers -productVersion)"
83 if [ -f /etc
/os-release
]; then
85 # shellcheck disable=SC1091
87 printf ", %s, %s, %s" "${NAME:-$(uname -v)}" "${VERSION:-noversion}" "${BUILD_ID:-nobuild}"
93 if nix-build
--no-out-link @multiusertest@
2>&1 | debuglog
; then
100 desc_nixpkgs_path
() {
105 find /nix
/var
/nix
/profiles
/per-user \
111 while IFS
= read -r -d '' userchannelset
; do
112 manifest
="$userchannelset/manifest.nix"
114 if [ -e "$manifest" ]; then
115 userchannels
=$
(nixev \
116 "builtins.concatStringsSep \", \"
118 (import \"$manifest\"))")
120 fact
"channels($(echo "$manifest" | cut -d/ -f7))" \
127 if nix-build
--no-out-link @sandboxtest@
2>&1 | debuglog
; then
129 elif nix-build
--no-out-link @relaxedsandboxtest@
2>&1 | debuglog
; then
140 if [ $MARKDOWN -eq 0 ]; then
141 printf "%s: %s" "$name" "$value"
142 if [ "$last" -eq 1 ]; then
146 printf " - %s: \`%s\`\\n" "$name" "$value"
149 if [ "$last" -eq 0 ]; then
158 fact
"system" "$(desc_system)"
159 if [ $HOST_OS -eq 1 ]; then
160 fact
"host os" "$(desc_host_os)"
162 fact
"multi-user?" "$(desc_multi_user)"
163 if [ $SANDBOX -eq 1 ]; then
164 fact
"sandbox" "$(desc_sandbox)"
167 fact
"version" "$(nix-env --version)"
169 last_fact
"nixpkgs" "$(desc_nixpkgs_path)"