2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchurl
|
|
|
|
, sqlite
|
|
|
|
, installShellFiles
|
2023-10-09 19:29:22 +00:00
|
|
|
, nixosTests
|
2023-08-22 20:05:09 +00:00
|
|
|
}:
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "honk";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.1.1";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://humungus.tedunangst.com/r/honk/d/honk-${version}.tgz";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-kfoSVGm1QKVjDiWvjK4QzAoA/iiU9j6DS3SYFSM+AaA=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
vendorHash = null;
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
buildInputs = [
|
|
|
|
sqlite
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
# This susbtitution is not mandatory. It is only existing to have something
|
|
|
|
# working out of the box. This value can be overriden by the user, by
|
|
|
|
# providing the `-viewdir` parameter in the command line.
|
2022-12-17 10:02:37 +00:00
|
|
|
postPatch = ''
|
2023-08-22 20:05:09 +00:00
|
|
|
substituteInPlace main.go --replace \
|
2022-12-17 10:02:37 +00:00
|
|
|
"var viewDir = \".\"" \
|
|
|
|
"var viewDir = \"$out/share/honk\""
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/${pname}
|
|
|
|
mkdir -p $out/share/doc/${pname}
|
|
|
|
|
|
|
|
mv docs/{,honk-}intro.1
|
|
|
|
mv docs/{,honk-}hfcs.1
|
|
|
|
mv docs/{,honk-}vim.3
|
|
|
|
mv docs/{,honk-}activitypub.7
|
|
|
|
|
|
|
|
installManPage docs/honk.1 docs/honk.3 docs/honk.5 docs/honk.8 \
|
|
|
|
docs/honk-intro.1 docs/honk-hfcs.1 docs/honk-vim.3 docs/honk-activitypub.7
|
|
|
|
mv docs/{*.html,*.txt,*.jpg,*.png} $out/share/doc/${pname}
|
|
|
|
mv views $out/share/${pname}
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) honk;
|
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://humungus.tedunangst.com/r/honk/v/v${version}/f/docs/changelog.txt";
|
2022-12-17 10:02:37 +00:00
|
|
|
description = "An ActivityPub server with minimal setup and support costs.";
|
|
|
|
homepage = "https://humungus.tedunangst.com/r/honk";
|
2023-08-22 20:05:09 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
mainProgram = "honk";
|
|
|
|
maintainers = with lib.maintainers; [ huyngo ];
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
}
|