about summary refs log tree commit diff
path: root/pkgs/aszlig/nlast
Commit message (Collapse)AuthorAgeFilesLines
* profiles/base: Add helper for showing last Nix logaszlig2020-12-101-0/+13
This is a common pattern I encounter on a daily basis, which involves copy & pasting the store path of a failed build to "nix log". Now the same is just a matter of running "nlast" and we get rid of the useless copy & paste. The way we do this does have a small goof: Using mtime (or really any time, other than atime, which commonly is disabled) is not going to work if we *repeat* an older Nix build, since this will only change the log file but the prefix directory will be unchanged. Since addressing this goof would most likely result in iterating through *all* log files, I'm not doing it since I think it doesn't occur very often in practice. If I happen to be wrong on that, we could still go for the heavyweight solution. Also, I went for implementing this in Python instead of a shell script, because the latter would not only be less readable but also way slower since we need to either fork out for every stat command or use ls and head to figure out the newest file. Signed-off-by: aszlig <aszlig@nix.build>