about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/sh/shopware-cli/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/sh/shopware-cli/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/sh/shopware-cli/package.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/sh/shopware-cli/package.nix b/nixpkgs/pkgs/by-name/sh/shopware-cli/package.nix
new file mode 100644
index 000000000000..ac7a6ec1f18f
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/sh/shopware-cli/package.nix
@@ -0,0 +1,51 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+, makeWrapper
+, dart-sass
+, git
+}:
+
+buildGoModule rec {
+  pname = "shopware-cli";
+  version = "0.3.6";
+  src = fetchFromGitHub {
+    repo = "shopware-cli";
+    owner = "FriendsOfShopware";
+    rev = version;
+    hash = "sha256-3Js44cLS6GLI6wFuT2wxgwyMF3beXaULVeaejfxxtA0=";
+  };
+
+  nativeBuildInputs = [ installShellFiles makeWrapper ];
+  nativeCheckInputs = [ git dart-sass ];
+
+  vendorHash = "sha256-QZ/zU67oUW75T8DOzjQwmEAr6gjIg/6ZO4Vm/47Lc40=";
+
+  postInstall = ''
+    export HOME="$(mktemp -d)"
+    installShellCompletion --cmd shopware-cli \
+      --bash <($out/bin/shopware-cli completion bash) \
+      --zsh <($out/bin/shopware-cli completion zsh) \
+      --fish <($out/bin/shopware-cli completion fish)
+  '';
+
+  preFixup = ''
+    wrapProgram $out/bin/shopware-cli \
+      --prefix PATH : ${lib.makeBinPath [ dart-sass ]}
+  '';
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X 'github.com/FriendsOfShopware/shopware-cli/cmd.version=${version}'"
+  ];
+
+  meta = with lib; {
+    description = "Command line tool for Shopware 6";
+    homepage = "https://github.com/FriendsOfShopware/shopware-cli";
+    changelog = "https://github.com/FriendsOfShopware/shopware-cli/releases/tag/${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ shyim ];
+  };
+}