xin/pkgs/gotosocial.nix

50 lines
1.2 KiB
Nix
Raw Normal View History

2022-10-04 21:57:49 -06:00
{ stdenv, lib, buildGo119Module, fetchFromGitHub, makeWrapper, go, git, ffmpeg
, ... }:
let
2022-10-04 14:02:54 -06:00
gotosocialVersion = "0.5.2";
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";
2022-10-04 14:02:54 -06:00
sha256 = "sha256:10gqjzcp2j88cps44g7c2zdnz3is4i534ns29m9h57b7704zlqjn";
};
2022-09-12 21:53:58 -06:00
in with lib;
2022-10-04 14:02:54 -06:00
buildGo119Module rec {
pname = "gotosocial";
version = gotosocialVersion;
src = fetchFromGitHub {
owner = "superseriousbusiness";
repo = pname;
rev = "v${version}";
2022-10-04 14:02:54 -06:00
hash = "sha256-fQDxU2+sj0QhGOQQRVjKzlyi1PEm/O0B8/V4cac4Kdo=";
};
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;
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 ];
};
}