xin/pkgs/gotosocial.nix

56 lines
1.3 KiB
Nix
Raw Normal View History

2023-03-22 10:35:46 -06:00
{ lib, buildGo119Module, fetchFromGitHub, go, ffmpeg, ... }:
let
2023-05-24 09:46:04 -06:00
gotosocialVersion = "0.9.0";
gtswaHash = "sha256:1yxyl8q0dqpv3cqzxj0anh8rskk3rmw9mjnjkm4svc0vgaph1y1s";
gtssHash = "sha256-UZRIQTdVESCYv2KW7HUS2c4bS5qnB7wdwiYAgEJ60fU=";
gotosocialWebAssets = builtins.fetchurl {
2022-09-12 21:53:58 -06:00
url =
"https://github.com/superseriousbusiness/gotosocial/releases/download/v${gotosocialVersion}/gotosocial_${gotosocialVersion}_web-assets.tar.gz";
sha256 = gtswaHash;
};
2022-09-12 21:53:58 -06:00
in with lib;
2022-11-29 06:24:55 -07:00
buildGo119Module 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;
vendorSha256 = null;
2022-09-26 07:49:55 -06:00
doCheck = false;
preBuild = ''
echo ${go}/bin/go
${go}/bin/go version
2023-01-03 08:24:11 -07:00
'';
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 ];
};
}