nixpkgs/pkgs/by-name/ho/honk/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

66 lines
1.6 KiB
Nix

{ lib
, buildGoModule
, fetchurl
, sqlite
, installShellFiles
, nixosTests
}:
buildGoModule rec {
pname = "honk";
version = "1.4.1";
src = fetchurl {
url = "https://humungus.tedunangst.com/r/honk/d/honk-${version}.tgz";
hash = "sha256-o9K/ht31nEbx2JmLG3OSIgKZGygpDhZYqCxs6tuSnlc=";
};
vendorHash = null;
buildInputs = [
sqlite
];
nativeBuildInputs = [
installShellFiles
];
subPackages = [ "." ];
# This susbtitution is not mandatory. It is only existing to have something
# working out of the box. This value can be overridden by the user, by
# providing the `-viewdir` parameter in the command line.
postPatch = ''
substituteInPlace main.go --replace-fail \
"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}
'';
passthru.tests = {
inherit (nixosTests) honk;
};
meta = {
changelog = "https://humungus.tedunangst.com/r/honk/v/v${version}/f/docs/changelog.txt";
description = "ActivityPub server with minimal setup and support costs";
homepage = "https://humungus.tedunangst.com/r/honk";
license = lib.licenses.isc;
mainProgram = "honk";
maintainers = with lib.maintainers; [ huyngo ];
};
}