Skip to content

Commit

Permalink
Copy passthru argument to resulting derivation
Browse files Browse the repository at this point in the history
After the refactoring it was missed. Fixes #13.
  • Loading branch information
zaninime committed Nov 1, 2022
1 parent fe0044d commit 0793ced
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/sbt-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ in
// {
nativeBuildInputs = [sbt] ++ nativeBuildInputs;

passthru.dependencies = dependencies;
passthru =
passthru
// {
inherit dependencies;
};

configurePhase = ''
runHook preConfigure
Expand Down
16 changes: 16 additions & 0 deletions tests/misc.bats
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,19 @@ setup() {
assert_success
assert_output --partial 'type = "derivation";'
}

@test "correctly sets passthru" {
run nix-instantiate --eval -E - <<- EOF
((builtins.getFlake "$tests_dir/..").outputs.lib.mkSbtDerivation {
pkgs = import <nixpkgs> {};
pname = "";
version = "";
src = ./.;
depsSha256 = "";
passthru.foo = "bar";
}).passthru
EOF

assert_success
assert_output --partial 'foo = "bar"'
}

0 comments on commit 0793ced

Please sign in to comment.