nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 installShellFiles,
5 php,
6 nix-update-script,
7 versionCheckHook,
8}:
9
10php.buildComposerProject2 (finalAttrs: {
11 pname = "castor";
12 version = "1.1.0";
13
14 src = fetchFromGitHub {
15 owner = "jolicode";
16 repo = "castor";
17 tag = "v${finalAttrs.version}";
18 hash = "sha256-HgFFy/qEN7fPCFqDJe1SLMpDWB04YPI6OPYaURqjyKQ=";
19 };
20
21 vendorHash = "sha256-RBN99M5YFee8FZURn4lVuscrCmajMNn+10KgwqgPk8k=";
22
23 nativeBuildInputs = [ installShellFiles ];
24
25 # install shell completions
26 postInstall = ''
27 installShellCompletion --cmd castor \
28 --bash <(php $out/bin/castor completion bash) \
29 --fish <(php $out/bin/castor completion fish) \
30 --zsh <(php $out/bin/castor completion zsh)
31 '';
32
33 doInstallCheck = true;
34 nativeInstallCheckInputs = [ versionCheckHook ];
35
36 passthru = {
37 updateScript = nix-update-script { };
38 };
39
40 meta = {
41 changelog = "https://github.com/jolicode/castor/blob/v${finalAttrs.version}/CHANGELOG.md";
42 description = "DX oriented task runner and command launcher built with PHP";
43 homepage = "https://github.com/jolicode/castor";
44 license = lib.licenses.mit;
45 maintainers = [ ];
46 mainProgram = "castor";
47 };
48})