blob: 1025a90fbd377069a5a4b63810003dbf3b6c7fc8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
{
lib,
mkYarnPackage,
fetchFromGitHub,
makeWrapper,
nodejs,
fetchYarnDeps,
}:
mkYarnPackage rec {
pname = "prettierd";
version = "0.25.3";
src = fetchFromGitHub {
owner = "fsouza";
repo = "prettierd";
rev = "v${version}";
hash = "sha256-3lvFZ5/p+1kPnHIR2PlQtCY3SVo1rs8IuBigLaabxAE=";
};
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
hash = "sha256-Ti2b102pzUKB6Xy3LwZ7DlrnW0cRscgNLTUIAKz+6Us=";
};
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;
meta = {
mainProgram = "prettierd";
description = "Prettier, as a daemon, for improved formatting speed";
homepage = "https://github.com/fsouza/prettierd";
license = lib.licenses.isc;
changelog = "https://github.com/fsouza/prettierd/blob/${src.rev}/CHANGELOG.md";
platforms = with lib.platforms; linux ++ darwin;
maintainers = with lib.maintainers; [
NotAShelf
n3oney
];
};
}
|