This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/matrix/matrix-media-repo/default.nix

27 lines
927 B
Nix
Raw Normal View History

2022-06-12 13:06:20 +00:00
{inputs, ...} @ args: let
pkgs = import inputs.nixpkgs-go116 {inherit (args.pkgs) system;};
2022-06-14 05:21:15 +00:00
inherit ((pkgs.callPackage "${inputs.gomod2nix}/builder" {})) buildGoApplication;
2022-06-12 13:06:20 +00:00
in {
matrix-media-repo = buildGoApplication rec {
pname = "matrix-media-repo";
version = inputs.matrix-media-repo.lastModifiedDate;
src = pkgs.callPackage ./source.nix {};
2022-06-12 13:06:20 +00:00
go = pkgs.go_1_16;
proxyVendor = true;
modules = ./gomod2nix.toml;
nativeBuildInputs = [
pkgs.git
];
2022-06-12 14:22:57 +00:00
CGO_ENABLED = "1";
2022-06-12 13:06:20 +00:00
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=${version}" -v ./cmd/...
2022-06-12 13:06:20 +00:00
'';
installPhase = ''
mkdir $out
cp -rv bin $out
'';
};
}