Skip to content

Commit

Permalink
lib: tarSource: fix evaluation with no hash
Browse files Browse the repository at this point in the history
Passing a null hash to mkDerivation now throws an error.
  • Loading branch information
lopsided98 committed Nov 26, 2023
1 parent 15e5129 commit 2427b84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
compress ? false,
hook ? "",
hash ? null
}: src: self.runCommand ("${src.name}.tar" + lib.optionalString compress ".gz") {
}: src: self.runCommand ("${src.name}.tar" + lib.optionalString compress ".gz") ({
inherit src;
} // lib.optionalAttrs (hash != null) {
outputHashMode = "flat";
outputHash = hash;
} ''
}) ''
unpackPhase
pushd "$sourceRoot"
${hook}
Expand Down

0 comments on commit 2427b84

Please sign in to comment.