From 1771b6692c4882ced0534e110acfad97a026ef93 Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Fri, 27 Jan 2023 07:13:00 +0800 Subject: [PATCH] phylactery: use buildGoModule (#208980) Co-authored-by: Sandro --- pkgs/servers/web-apps/phylactery/default.nix | 18 +++++++++++------- pkgs/servers/web-apps/phylactery/go.mod | 3 +++ 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 pkgs/servers/web-apps/phylactery/go.mod diff --git a/pkgs/servers/web-apps/phylactery/default.nix b/pkgs/servers/web-apps/phylactery/default.nix index cd89da943042..e7756e4bb3b6 100644 --- a/pkgs/servers/web-apps/phylactery/default.nix +++ b/pkgs/servers/web-apps/phylactery/default.nix @@ -1,20 +1,24 @@ -{ lib, buildGoPackage, fetchFromSourcehut, nixosTests }: +{ lib, buildGoModule, fetchFromSourcehut, nixosTests }: -buildGoPackage rec { +buildGoModule rec { pname = "phylactery"; version = "0.1.2"; - goPackagePath = "git.sr.ht/~cnx/phylactery"; - src = fetchFromSourcehut { owner = "~cnx"; repo = pname; rev = version; - sha256 = "sha256-HQN6wJ/4YeuQaDcNgdHj0RgYnn2NxXGRfxybmv60EdQ="; + hash = "sha256-HQN6wJ/4YeuQaDcNgdHj0RgYnn2NxXGRfxybmv60EdQ="; }; - # Upstream repo doesn't provide any test. - doCheck = false; + vendorHash = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="; + + preBuild = '' + cp ${./go.mod} go.mod + ''; + + ldflags = [ "-s" "-w" ]; + passthru.tests.phylactery = nixosTests.phylactery; meta = with lib; { diff --git a/pkgs/servers/web-apps/phylactery/go.mod b/pkgs/servers/web-apps/phylactery/go.mod new file mode 100644 index 000000000000..4ec9652e23fe --- /dev/null +++ b/pkgs/servers/web-apps/phylactery/go.mod @@ -0,0 +1,3 @@ +module git.sr.ht/~cnx/phylactery + +go 1.18