nixos-config/packages/matrix/matrix-media-repo.nix

28 lines
823 B
Nix
Raw Normal View History

{ buildGo116Module
2022-04-29 16:34:08 +00:00
, fetchFromGitHub
, git
}: buildGo116Module rec {
2022-04-29 16:34:08 +00:00
pname = "matrix-media-repo";
version = "1.2.12";
src = fetchFromGitHub {
owner = "turt2live";
2022-04-29 16:34:08 +00:00
repo = pname;
rev = "v${version}";
sha256 = "1j6y7alr60mmj5h014qmpz9a5qjv8cm61andwdacb0dqjjbvsm0z";
2022-04-29 16:34:08 +00:00
};
proxyVendor = true;
vendorSha256 = "sha256-gb2inc/XlPAplVYQXmR77b3/5GsEZDg5v7D/FbZRQ7w=";
2022-04-29 16:34:08 +00:00
nativeBuildInputs = [
git
];
buildPhase = ''
GOBIN=$PWD/bin go install -v ./cmd/compile_assets
$PWD/bin/compile_assets
GOBIN=$PWD/bin go install -ldflags "-X github.com/turt2live/matrix-media-repo/common/version.GitCommit=$(git rev-list -1 HEAD) -X github.com/turt2live/matrix-media-repo/common/version.Version=$(git describe --tags)" -v ./cmd/...
'';
installPhase = ''
mkdir $out
cp -rv bin $out
'';
}