xin/pkgs/gotosocial.nix

62 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2023-07-11 09:12:50 -06:00
{
lib,
2023-08-11 07:36:51 -06:00
buildGoModule,
2023-07-11 09:12:50 -06:00
fetchFromGitHub,
go,
ffmpeg,
...
}: let
2023-08-15 07:34:58 -06:00
gotosocialVersion = "0.11.0";
gtswaHash = "sha256:0qbs4a3wblrlcr1l5155p54vdd6hn2szkdns99wxjhjr8kw6dbil";
gtssHash = "sha256-qbq5pDvG2L1s6BG+sh7eagcFNH/DWyANMQaAl2WcQzE=";
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
with lib;
2023-08-11 07:36:51 -06:00
buildGoModule rec {
2023-07-11 09:12:50 -06:00
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;
vendorSha256 = 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];
};
}