Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 stdenv,
3 lib,
4 buildGoModule,
5 fetchFromGitHub,
6 nix-update-script,
7 installShellFiles,
8 writableTmpDirAsHomeHook,
9}:
10
11buildGoModule (finalAttrs: {
12 pname = "neonmodem";
13 version = "1.0.7";
14
15 src = fetchFromGitHub {
16 owner = "mrusme";
17 repo = "neonmodem";
18 tag = "v${finalAttrs.version}";
19 hash = "sha256-gwhQG8H1OnGQmawPQ3m6VKVooBh8rZaNr6FDl6fgZXc=";
20 };
21
22 vendorHash = "sha256-zqQtuyFrsDB1xRdl4cbaTsCawMrBvcu78zXgU2jUwHI=";
23
24 passthru.updateScript = nix-update-script { };
25
26 nativeBuildInputs = [
27 installShellFiles
28 writableTmpDirAsHomeHook
29 ];
30
31 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
32 # Will otherwise panic if it can't open $HOME/{Library/Caches,.cache}/neonmodem.log
33 # Upstream issue: https://github.com/mrusme/neonmodem/issues/53
34 mkdir -p "$HOME/${if stdenv.buildPlatform.isDarwin then "Library/Caches" else ".cache"}"
35
36 installShellCompletion --cmd neonmodem \
37 --bash <($out/bin/neonmodem completion bash) \
38 --fish <($out/bin/neonmodem completion fish) \
39 --zsh <($out/bin/neonmodem completion zsh)
40 '';
41
42 meta = {
43 description = "BBS-style TUI client for Discourse, Lemmy, Lobsters, and Hacker News";
44 homepage = "https://neonmodem.com";
45 downloadPage = "https://github.com/mrusme/neonmodem/releases";
46 changelog = "https://github.com/mrusme/neonmodem/releases/tag/v${finalAttrs.version}";
47 license = lib.licenses.gpl3Only;
48 maintainers = with lib.maintainers; [ acuteaangle ];
49 mainProgram = "neonmodem";
50 };
51})