Skip to content

Instantly share code, notes, and snippets.

@bgamari
Created March 1, 2019 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgamari/c833c68257a237d77789d4d9fcbba808 to your computer and use it in GitHub Desktop.
Save bgamari/c833c68257a237d77789d4d9fcbba808 to your computer and use it in GitHub Desktop.
# We can't use `nix log` within a nix derivation builder so we instead
# generate a bash script which we call from the outside.
collectLogs =
let
exportLog = name: drv: ''
nix log ${toString drv.drvPath} > ${name}.log
'';
in
nixpkgs.writeScriptBin "collect-logs.sh"
(lib.concatStrings (lib.mapAttrsToList exportLog testedPackages));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment