xin/pkgs/gotosocial.nix

61 lines
1.3 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, go
, ffmpeg
, ...
}:
let
gotosocialVersion = "0.14.2";
gtswaHash = "sha256:1x805rcdn6fn7yh2bndlbwp9pv36rshazn891m7dj7akq0zqx96x";
gtssHash = "sha256-oeOxP9FkGsOH66Uk946H0b/zggz536YvRRuo1cINxSM=";
gotosocialWebAssets = builtins.fetchurl {
url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v${gotosocialVersion}/gotosocial_${gotosocialVersion}_web-assets.tar.gz";
sha256 = gtswaHash;
};
in
with lib;
buildGoModule rec {
pname = "gotosocial";
version = gotosocialVersion;
src = fetchFromGitHub {
owner = "superseriousbusiness";
repo = pname;
rev = "v${version}";
hash = gtssHash;
};
ldflags = [
"-s"
"-w"
"-extldflags '-static'"
"-X 'main.Commit=${version}'"
"-X 'main.Version=${version}'"
];
propagatedBuildInputs = [ ffmpeg ];
proxyVendor = false;
vendorHash = null;
doCheck = false;
preBuild = ''
echo ${go}/bin/go
${go}/bin/go version
'';
postInstall = ''
mkdir -p $out/assets
tar -C $out/assets/ -zxvf ${gotosocialWebAssets}
'';
meta = {
description = "Fast, fun, ActivityPub server, powered by Go.";
homepage = "https://github.com/superseriousbusiness/gotosocial";
license = licenses.agpl3;
maintainers = with maintainers; [ qbit ];
};
}