aboutsummaryrefslogtreecommitdiff
path: root/pkgs/chef/default.nix
blob: b76596607fc1a8be410df179e907c8ae7f77e37c (plain)
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
{ rustPlatform, fetchFromGitHub, lib, installShellFiles
, ... }:
let
  pname = "cooklang-chef";
  version = "0.10.0";
  src = fetchFromGitHub {
    owner = "Zheoni";
    repo = "cooklang-chef";
    rev = "v${version}";
    hash = "sha256-YPsofecsdiJE4rWVy82ao99YZiCPEPoF14XavTAhq+w=";
  };
in rustPlatform.buildRustPackage {
  inherit pname version src;

  cargoHash = "sha256-77KPW4SQ9KI0H+ND3mFITJjftLjpLMXi7qp0PUZOINw=";

  nativeBuildInputs = [
    installShellFiles
  ];

  postInstall = ''
    export XDG_CONFIG_HOME=$out/share

    for s in bash fish zsh; do
      installShellCompletion --cmd chef --$s <($out/bin/chef generate-completions $s)
    done
  '';

  # passthru = {
  #   inherit ui;
  # };

  meta = with lib; {
    homepage = "https://github.com/Zheoni/cooklang-chef";
    description = "A CLI to manage cooklang recipes with extensions";
    license = licenses.mit;
    mainProgram = "chef";
  };
}