lol

nixos/activation: Identifies the snippet that failed

This allows a developer to better identify in which snippet the
failure happened. Furthermore, users seeking help will have more
information available about the failure.

+6 -1
+6 -1
nixos/modules/system/activation/activation-script.nix
··· 8 8 addAttributeName = mapAttrs (a: v: v // { 9 9 text = '' 10 10 #### Activation script snippet ${a}: 11 + _localstatus=0 11 12 ${v.text} 13 + 14 + if (( _localstatus > 0 )); then 15 + printf "Activation script snippet '%s' failed (%s)\n" "${a}" "$_localstatus" 16 + fi 12 17 ''; 13 18 }); 14 19 ··· 71 76 done 72 77 73 78 _status=0 74 - trap "_status=1" ERR 79 + trap "_status=1 _localstatus=\$?" ERR 75 80 76 81 # Ensure a consistent umask. 77 82 umask 0022