lol
1{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
2
3buildGoModule rec {
4 pname = "mangal";
5 version = "4.0.6";
6
7 src = fetchFromGitHub {
8 owner = "metafates";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256-nbJdePlzZFM2ihbvFIMKyYZ9C0uKjU3TE5VLduLvtKE=";
12 };
13
14 proxyVendor = true;
15 vendorHash = null;
16
17 ldflags = [ "-s" "-w" ];
18
19 nativeBuildInputs = [ installShellFiles ];
20
21 postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
22 # Mangal creates a config file in the folder ~/.config/mangal and fails if not possible
23 export MANGAL_CONFIG_PATH=`mktemp -d`
24 installShellCompletion --cmd mangal \
25 --bash <($out/bin/mangal completion bash) \
26 --zsh <($out/bin/mangal completion zsh) \
27 --fish <($out/bin/mangal completion fish)
28 '';
29
30 doCheck = false; # test fail because of sandbox
31
32 meta = with lib; {
33 description =
34 "A fancy CLI app written in Go which scrapes, downloads and packs manga into different formats";
35 homepage = "https://github.com/metafates/mangal";
36 license = licenses.mit;
37 maintainers = [ maintainers.bertof ];
38 };
39}