@@ -1,7 +1,8 @@
1−{ lib, fetchFromGitHub, buildGoModule }:
1+{ lib, fetchFromGitHub, buildGoModule
2+, enableUnfree ? true }:
23
34buildGoModule rec {
4− name = "drone.io-${version}";
5+ pname = "drone.io${lib.optionalString (!enableUnfree) "-oss"}";
56 version = "1.10.0";
67
78 vendorSha256 = "sha256-cKHX/GnvGELQBfoo0/1UmDQ4Z66GGnnHG7+1CzjinL0=";
@@ -15,9 +16,13 @@ buildGoModule rec {
1516 sha256 = "sha256-12Jac+mXWdUX8gWvmpdO9ROv7Bi0YzvyqnNDVNJOr34=";
1617 };
1718
19+ preBuild = ''
20+ buildFlagsArray+=( "-tags" "${lib.optionalString (!enableUnfree) "oss nolimit"}" )
21+ '';
22+
1823 meta = with lib; {
1924 maintainers = with maintainers; [ elohmeier vdemeester ];
20− license = licenses.asl20;
25+ license = with licenses; if enableUnfree then unfreeRedistributable else asl20;
2126 description = "Continuous Integration platform built on container technology";
2227 };
2328}