xin/pkgs/gotosocial.nix

61 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2023-09-12 08:44:05 -06:00
{ lib
, buildGoModule
, fetchFromGitHub
, go
, ffmpeg
, ...
}:
let
2023-12-18 08:51:33 -07:00
gotosocialVersion = "0.13.0";
gtswaHash = "sha256:0zd7vxh5c9kwjkhw7npqzwm7y7dirfp1y0gw0ma8hzxlxxyn7z38";
gtssHash = "sha256-+/x3CAGF/cjK1/7fHgC8EzlGR/Xmq3aFL5Ogc/QZCpA=";
gotosocialWebAssets = builtins.fetchurl {
2023-07-11 09:12:50 -06:00
url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v${gotosocialVersion}/gotosocial_${gotosocialVersion}_web-assets.tar.gz";
sha256 = gtswaHash;
};
2023-07-11 09:12:50 -06:00
in
2023-09-12 08:44:05 -06:00
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;
2023-11-15 10:23:30 -07:00
vendorHash = null;
2023-09-12 08:44:05 -06:00
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 ];
};
}