nixpkgs/pkgs/servers/honk/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchurl, installShellFiles, sqlite }:
buildGoModule rec {
pname = "honk";
2023-08-17 16:12:07 +00:00
version = "1.0.0";
src = fetchurl {
url = "https://humungus.tedunangst.com/r/honk/d/honk-${version}.tgz";
2023-08-17 16:12:07 +00:00
hash = "sha256-+0W9HncN+51dRE9bWJU4cAfYOc5bxNAqPe4xY+4UFg0=";
};
vendorHash = null;
buildInputs = [ sqlite ];
nativeBuildInputs = [ installShellFiles ];
subPackages = [ "." ];
2023-08-17 16:12:07 +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.
postPatch = ''
2023-08-18 10:34:45 +00:00
substituteInPlace main.go --replace \
"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}
'';
meta = with lib; {
2023-08-17 20:51:07 +00:00
changelog = "https://humungus.tedunangst.com/r/honk/v/v${version}/f/docs/changelog.txt";
description = "An ActivityPub server with minimal setup and support costs.";
homepage = "https://humungus.tedunangst.com/r/honk";
license = licenses.isc;
2023-08-17 16:12:26 +00:00
mainProgram = "honk";
maintainers = with maintainers; [ huyngo ];
};
}