about summary refs log tree commit diff
path: root/pkgs/aszlig/default.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2020-12-10 02:30:45 +0100
committeraszlig <aszlig@nix.build>2020-12-10 02:53:01 +0100
commitceab386076cc98ac447c8bbc768691bce5bf8ac6 (patch)
treec5067439353482f4b158937e4809a5dffa00384d /pkgs/aszlig/default.nix
parente0cf8a362d95a7094adec78d11bbf8d4b7d7b547 (diff)
profiles/base: Add helper for showing last Nix log
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>
Diffstat (limited to 'pkgs/aszlig/default.nix')
-rw-r--r--pkgs/aszlig/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/aszlig/default.nix b/pkgs/aszlig/default.nix
index d3f42882..81178000 100644
--- a/pkgs/aszlig/default.nix
+++ b/pkgs/aszlig/default.nix
@@ -9,6 +9,7 @@
   librxtx_java = callPackage ./librxtx-java { };
   lockdev = callPackage ./lockdev { };
   mutt = callPackage ./mutt { inherit mutt; };
+  nlast = callPackage ./nlast { };
   psi = callPackage ./psi { };
   pvolctrl = callPackage ./pvolctrl { };
   vim = callPackage ./vim { vim = vim_configurable; };