nixpkgs/pkgs/os-specific/linux/nixos-rebuild
Profpatsch cb7bc7c60f nixos-rebuild: Print commands as they are run on verbose flag
nixos-rebuild would forward all verbose flags to nix, but not actually
increase its own verbosity.
Which would make it hard to see what’s going on without resorting to
tools like strace or adding `set -x` to the script.

We add a simple exec wrapper around the most “interesting” commands,
that is nix tool invocations. If any verbosity flag is given, it will
set the verbosity flag of the nixos-rebuild script all commands
wrapped into `runCmd` will start logging their invocation.

This is done via a `logVerbose` function, which can also be used to
print logging messages when in verbose mode, to aid debugging why
nixos-rebuild does what it does. A few messages are added, but
potentially we could log a lot more details.

Now, testing all of the changed code paths turns out to be rather
hard, so I am unsure how to verify that for all changed commands
behaviour stays indeed the same.
2022-03-19 15:13:50 +01:00
..
default.nix nixos-rebuild: remove jq 2022-01-04 20:02:47 -03:00
nixos-rebuild.sh nixos-rebuild: Print commands as they are run on verbose flag 2022-03-19 15:13:50 +01:00