diff --git a/packages/default.nix b/packages/default.nix index 64fa60b..9029d85 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -81,6 +81,12 @@ in builder = {pkgs, ...}: pkgs.callPackage; }; + lego = { + source = ./lego; + platforms = ["x86_64-linux"]; + builder = {pkgs, ...}: pkgs.callPackage; + }; + # Pass for cache # ISSUE: attribute 'targetPlatforms' missing diff --git a/packages/lego/default.nix b/packages/lego/default.nix new file mode 100644 index 0000000..f77d481 --- /dev/null +++ b/packages/lego/default.nix @@ -0,0 +1,41 @@ +{ + bonLib, + lib, + fetchFromGitHub, + buildGoModule, + nixosTests, + version ? "0bbf5ab59cda8beaedf5b1ce21a3d1bf0eb48fc5", + hash ? "sha256-j6AlA9+whDxvpbZBCnJinKTb0+bJrSqnMgCqmWWfLig=", + vendorHash ? "sha256-r9R+d5H5RjwzksbAlcFPyRtCGXSH1JBVfNHr5QiHA7Y=", + ... +}: +buildGoModule rec { + pname = "lego"; + inherit version; + + src = fetchFromGitHub { + owner = "go-acme"; + repo = "lego"; + rev = version; + hash = hash; + }; + + inherit vendorHash; + + doCheck = false; + + subPackages = ["cmd/lego"]; + + ldflags = [ + "-X main.version=${version}" + ]; + + meta = with lib; { + description = "Let's Encrypt client and ACME library written in Go"; + license = licenses.mit; + homepage = "https://go-acme.github.io/lego/"; + maintainers = with bonLib.maintainers; [L-Nafaryus]; + }; + + passthru.tests.lego = nixosTests.acme; +}