depot/pkgs/by-name/ni/nitter/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

53 lines
1.3 KiB
Nix

{ lib
, buildNimPackage
, fetchFromGitHub
, nixosTests
, substituteAll
, unstableGitUpdater
}:
buildNimPackage (finalAttrs: prevAttrs: {
pname = "nitter";
version = "0-unstable-2024-02-26";
src = fetchFromGitHub {
owner = "zedeus";
repo = "nitter";
rev = "c6edec04901d0a37799499ed4c6921db640fb5a4";
hash = "sha256-N3d63nyVzUTa2+UemA1REFfVsw6iOVU8xUlYraR55m4=";
};
lockFile = ./lock.json;
patches = [
(substituteAll {
src = ./nitter-version.patch;
inherit (finalAttrs) version;
inherit (finalAttrs.src) rev;
url = builtins.replaceStrings [ "archive" ".tar.gz" ] [ "commit" "" ] finalAttrs.src.url;
})
];
postBuild = ''
nim compile ${toString finalAttrs.nimFlags} -r tools/gencss
nim compile ${toString finalAttrs.nimFlags} -r tools/rendermd
'';
postInstall = ''
mkdir -p $out/share/nitter
cp -r public $out/share/nitter/public
'';
passthru = {
tests = { inherit (nixosTests) nitter; };
updateScript = unstableGitUpdater { branch = "guest_accounts"; };
};
meta = with lib; {
homepage = "https://github.com/zedeus/nitter";
description = "Alternative Twitter front-end";
license = licenses.agpl3Only;
maintainers = with maintainers; [ erdnaxe infinidoge ];
mainProgram = "nitter";
};
})