this repo has no description
1{
2 stdenv,
3 fetchFromGitHub,
4 lib,
5 buildGoModule,
6}:
7
8let
9 version = "1.30.0";
10 src = fetchFromGitHub {
11 owner = "tw93";
12 repo = "Mole";
13 tag = "V${version}";
14 hash = "sha256-uo/wPKObL5i6A0i/1hmOjXCzlJkkrFsmZHvLoHmM8Ro=";
15 };
16
17 goComponents = buildGoModule {
18 pname = "mac-mole-go";
19 inherit version src;
20
21 ldflags = [
22 "-s"
23 "-w"
24 "-X main.Version=${version}"
25 ];
26
27 subPackages = [
28 "cmd/analyze"
29 "cmd/status"
30 ];
31
32 vendorHash = "sha256-oepnMZcaTB9u3h6S0jcP4W0pqNkDDgETVqDdCL0jarM=";
33 };
34
35in
36stdenv.mkDerivation (self: {
37 pname = "mac-mole";
38 inherit version src;
39
40 buildPhase = ''
41 script_dir="$out/libexec"
42
43 mkdir -p $out/bin $script_dir
44
45 cp -r ./bin $script_dir
46 cp -r ./lib $script_dir
47
48 ln -s ${goComponents}/bin/analyze $script_dir/bin/analyze-go
49 ln -s ${goComponents}/bin/status $script_dir/bin/status-go
50
51 cp mole $out/bin
52 ln -s $out/bin/mole $out/bin/mo
53
54 substituteInPlace $out/bin/mole \
55 --replace 'SCRIPT_DIR="$(cd "$(dirname "''${BASH_SOURCE[0]}")" && pwd)"' "SCRIPT_DIR='$script_dir'"
56 '';
57
58 meta = {
59 description = "Deep clean and optimize your Mac";
60 homepage = "https://github.com/tw93/Mole";
61 licenses = lib.licenses.mit;
62 mainProgram = "mole";
63 };
64})