2024-07-06 16:51:21 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
mkYarnPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
makeWrapper,
|
|
|
|
nodejs,
|
|
|
|
fetchYarnDeps,
|
2023-07-04 19:02:13 +00:00
|
|
|
}:
|
|
|
|
mkYarnPackage rec {
|
|
|
|
pname = "prettierd";
|
2024-04-25 17:19:32 +00:00
|
|
|
version = "0.25.3";
|
2023-07-04 19:02:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fsouza";
|
|
|
|
repo = "prettierd";
|
|
|
|
rev = "v${version}";
|
2024-04-25 17:19:32 +00:00
|
|
|
hash = "sha256-3lvFZ5/p+1kPnHIR2PlQtCY3SVo1rs8IuBigLaabxAE=";
|
2023-07-04 19:02:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = src + "/yarn.lock";
|
2024-04-25 17:19:32 +00:00
|
|
|
hash = "sha256-Ti2b102pzUKB6Xy3LwZ7DlrnW0cRscgNLTUIAKz+6Us=";
|
2023-07-04 19:02:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
packageJSON = ./package.json;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
yarn --offline build
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
# prettierd needs to be wrapped with nodejs so that it can be executed
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/prettierd" --prefix PATH : "${nodejs}/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doDist = false;
|
|
|
|
|
2024-07-06 16:51:21 +00:00
|
|
|
meta = {
|
2023-08-04 11:29:44 +00:00
|
|
|
mainProgram = "prettierd";
|
2023-07-04 19:02:13 +00:00
|
|
|
description = "Prettier, as a daemon, for improved formatting speed";
|
|
|
|
homepage = "https://github.com/fsouza/prettierd";
|
2024-07-06 16:51:21 +00:00
|
|
|
license = lib.licenses.isc;
|
2023-07-04 19:02:13 +00:00
|
|
|
changelog = "https://github.com/fsouza/prettierd/blob/${src.rev}/CHANGELOG.md";
|
2024-07-06 16:51:21 +00:00
|
|
|
platforms = with lib.platforms; linux ++ darwin;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
NotAShelf
|
|
|
|
n3oney
|
|
|
|
];
|
2023-07-04 19:02:13 +00:00
|
|
|
};
|
|
|
|
}
|