Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions pkgs/by-name/ne/neonmodem/package.nix
Original file line number Diff line number Diff line change
@@ -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";
};
})