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
66 if [ $DEBUG -eq 1 ]; then
74 nix-instantiate
--eval --strict -E "$1"
78 nixev
'builtins.currentSystem'
82 printf "%s" "$(uname -sr)"
84 if [ "$IS_DARWIN" = "yes" ]; then
85 printf ", macOS %s" "$(sw_vers -productVersion)"
88 if [ -f /etc
/os-release
]; then
90 # shellcheck disable=SC1091
92 printf ", %s, %s, %s" "${NAME:-$(uname -v)}" "${VERSION:-noversion}" "${BUILD_ID:-nobuild}"
98 if nix-build
--no-out-link @multiusertest@
2>&1 | debuglog
; then
105 desc_nixpkgs_path
() {
106 nixev
'<nixpkgs>' 2>/dev
/null ||
echo "not found"
110 find /nix
/var
/nix
/profiles
/per-user \
116 while IFS
= read -r -d '' userchannelset
; do
117 manifest
="$userchannelset/manifest.nix"
119 if [ -e "$manifest" ]; then
120 userchannels
=$
(nixev \
121 "builtins.concatStringsSep \", \"
123 (import \"$manifest\"))")
125 fact
"channels($(echo "$manifest" | cut -d/ -f7))" \
132 if nix-build
--no-out-link @sandboxtest@
2>&1 | debuglog
; then
134 elif nix-build
--no-out-link @relaxedsandboxtest@
2>&1 | debuglog
; then
145 if [ $MARKDOWN -eq 0 ]; then
146 printf "%s: %s" "$name" "$value"
147 if [ "$last" -eq 1 ]; then
151 printf " - %s: \`%s\`\\n" "$name" "$value"
154 if [ "$last" -eq 0 ]; then
163 fact
"system" "$(desc_system)"
164 if [ $HOST_OS -eq 1 ]; then
165 fact
"host os" "$(desc_host_os)"
167 fact
"multi-user?" "$(desc_multi_user)"
168 if [ $SANDBOX -eq 1 ]; then
169 fact
"sandbox" "$(desc_sandbox)"
172 fact
"version" "$(nix-env --version)"
174 last_fact
"nixpkgs" "$(desc_nixpkgs_path)"