diff --git a/pkgs/by-name/ne/neonmodem/package.nix b/pkgs/by-name/ne/neonmodem/package.nix new file mode 100644 index 000000000000..e38dab6772de --- /dev/null +++ b/pkgs/by-name/ne/neonmodem/package.nix @@ -0,0 +1,51 @@ +{ + stdenv, + lib, + buildGoModule, + fetchFromGitHub, + nix-update-script, + installShellFiles, + writableTmpDirAsHomeHook, +}: + +buildGoModule (finalAttrs: { + pname = "neonmodem"; + version = "1.0.6"; + + src = fetchFromGitHub { + owner = "mrusme"; + repo = "neonmodem"; + tag = "v${finalAttrs.version}"; + hash = "sha256-VLR6eicffA0IXVwEZMvgpm1kVmrLYVZOtq7MSy+vIw8="; + }; + + vendorHash = "sha256-pESNARoUgfg5/cTlTvKF3i7dTMIu0gRG/oV4Ov6h2cY="; + + passthru.updateScript = nix-update-script { }; + + nativeBuildInputs = [ + installShellFiles + writableTmpDirAsHomeHook + ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # Will otherwise panic if it can't open $HOME/{Library/Caches,.cache}/neonmodem.log + # Upstream issue: https://github.com/mrusme/neonmodem/issues/53 + mkdir -p "$HOME/${if stdenv.buildPlatform.isDarwin then "Library/Caches" else ".cache"}" + + installShellCompletion --cmd neonmodem \ + --bash <($out/bin/neonmodem completion bash) \ + --fish <($out/bin/neonmodem completion fish) \ + --zsh <($out/bin/neonmodem completion zsh) + ''; + + meta = { + description = "BBS-style TUI client for Discourse, Lemmy, Lobsters, and Hacker News"; + homepage = "https://neonmodem.com"; + downloadPage = "https://github.com/mrusme/neonmodem/releases"; + changelog = "https://github.com/mrusme/neonmodem/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ acuteaangle ]; + mainProgram = "neonmodem"; + }; +})